@@ -7,7 +7,7 @@ lae.proxmox
7
7
Installs and configures a Proxmox 5.x cluster with the following features:
8
8
9
9
- Ensures all hosts can connect to one another as root
10
- - Ability to create/manage groups, users, and access control lists
10
+ - Ability to create/manage groups, users, access control lists and storage
11
11
- Ability to create or add nodes to a PVE cluster
12
12
- IPMI watchdog support
13
13
- BYO HTTPS certificate support
@@ -46,8 +46,6 @@ Copy the following playbook to a file like `install_proxmox.yml`:
46
46
47
47
Install this role and a role for configuring NTP:
48
48
49
- # Changing ownership of the roles directory may be necessary:
50
- sudo chown $(whoami): /etc/ansible/roles
51
49
ansible-galaxy install lae.proxmox geerlingguy.ntp
52
50
53
51
Now you can perform the installation:
@@ -64,6 +62,11 @@ file containing a list of hosts).
64
62
Once complete, you should be able to access your Proxmox VE instance at
65
63
` https://$SSH_HOST_FQDN:8006 ` .
66
64
65
+ ## Support/Contributing
66
+
67
+ For support or if you'd like to contribute to this role but want guidance, feel
68
+ free to join this Discord server: https://discord.gg/cjqr6Fg
69
+
67
70
## Deploying a fully-featured PVE 5.x cluster
68
71
69
72
Create a new playbook directory. We call ours ` lab-cluster ` . Our playbook will
@@ -167,6 +170,13 @@ pve_acls:
167
170
- path: /
168
171
roles: [ "Administrator" ]
169
172
groups: [ "ops" ]
173
+ pve_storages:
174
+ - name: localdir
175
+ type: dir
176
+ content: [ "images", "iso", "backup" ]
177
+ path: /plop
178
+ maxfiles: 4
179
+
170
180
interfaces_template: "interfaces-{{ pve_group }}.j2"
171
181
```
172
182
@@ -201,6 +211,10 @@ are already in existing clusters with different names.
201
211
must already exist) to access PVE and gives them the Administrator role as part
202
212
of the ` ops ` group. Read the ** User and ACL Management** section for more info.
203
213
214
+ ` pve_storages ` allows to create different types of storage and configure them.
215
+ The backend needs to be supported by [ Proxmox] ( https://pve.proxmox.com/pve-docs/chapter-pvesm.html ) .
216
+ Read the ** Storage Management** section for more info.
217
+
204
218
` interfaces_template ` is set to the path of a template we'll use for configuring
205
219
the network on these Debian machines. This is only necessary if you want to
206
220
manage networking from Ansible rather than manually or via each host in PVE.
@@ -266,7 +280,7 @@ Finally, let's write our playbook. `site.yml` will look something like this:
266
280
template:
267
281
src: "{{ interfaces_template }}"
268
282
dest: /etc/network/interfaces
269
- register: __configure_interfaces
283
+ register: _configure_interfaces
270
284
271
285
- block:
272
286
- name: Reboot for networking changes
@@ -277,7 +291,7 @@ Finally, let's write our playbook. `site.yml` will look something like this:
277
291
- name: Wait for server to come back online
278
292
wait_for_connection:
279
293
delay: 15
280
- when: __configure_interfaces is changed
294
+ when: _configure_interfaces is changed
281
295
282
296
- hosts: pve
283
297
become: True
@@ -362,6 +376,7 @@ pve_repository_line: "deb http://download.proxmox.com/debian/pve stretch pve-no-
362
376
pve_remove_subscription_warning: true # patches the subscription warning messages in proxmox if you are using the community edition
363
377
pve_extra_packages: [] # Any extra packages you may want to install, e.g. ngrep
364
378
pve_run_system_upgrades: false # Let role perform system upgrades
379
+ pve_run_proxmox_upgrades: true # Let role perform Proxmox VE upgrades
365
380
pve_check_for_kernel_update: true # Runs a script on the host to check kernel versions
366
381
pve_reboot_on_kernel_update: false # If set to true, will automatically reboot the machine on kernel updates
367
382
pve_remove_old_kernels: true # Currently removes kernel from main Debian repository
@@ -376,6 +391,7 @@ pve_zfs_enabled: no # Specifies whether or not to install and configure ZFS pack
376
391
pve_ssl_letsencrypt: false # Specifies whether or not to obtain a SSL certificate using Let's Encrypt
377
392
pve_groups: [] # List of group definitions to manage in PVE. See section on User Management.
378
393
pve_users: [] # List of user definitions to manage in PVE. See section on User Management.
394
+ pve_storages: [] # List of storages to manage in PVE. See section on Storage Management.
379
395
```
380
396
381
397
To enable clustering with this role, configure the following variables appropriately:
@@ -465,15 +481,65 @@ pve_acls:
465
481
466
482
Refer to ` library/proxmox_acl.py ` [ link] [ acl-module ] for module documentation.
467
483
484
+ ## Storage Management
485
+
486
+ You can use this role to manage storage within Proxmox VE (both in
487
+ single server deployments and cluster deployments). For now, the only supported
488
+ types are ` dir ` , ` rbd ` , ` nfs ` , ` lvm ` and ` lvmthin ` .
489
+ Here are some examples.
490
+
491
+ ```
492
+ pve_storages:
493
+ - name: dir1
494
+ type: dir
495
+ content: [ "images", "iso", "backup" ]
496
+ path: /ploup
497
+ disable: no
498
+ maxfiles: 4
499
+ - name: ceph1
500
+ type: rbd
501
+ content: [ "images", "rootdir" ]
502
+ nodes: [ "lab-node01.local", "lab-node02.local" ]
503
+ username: admin
504
+ pool: rbd
505
+ krbd: yes
506
+ monhost:
507
+ - 10.0.0.1
508
+ - 10.0.0.2
509
+ - 10.0.0.3
510
+ - name: nfs1
511
+ type: nfs
512
+ content: [ "images", "iso" ]
513
+ server: 192.168.122.2
514
+ export: /data
515
+ - name: lvm1
516
+ type: lvm
517
+ content: [ "images", "rootdir" ]
518
+ vgname: vg1
519
+ - name: lvmthin1
520
+ type: lvmthin
521
+ content: [ "images", "rootdir" ]
522
+ vgname: vg2
523
+ thinpool: data
524
+ ```
525
+
526
+ Refer to ` library/proxmox_storage.py ` [ link] [ storage-module ] for module
527
+ documentation.
528
+
468
529
## Contributors
469
530
470
- Musee Ullah (
[ @lae ] ( https://github.com/lae ) ,
< [email protected] > )
471
- Engin Dumlu ([ @roadrunner ] ( https://github.com/roadrunner ) )
472
- Jonas Meurer ([ @mejo- ] ( https://github.com/mejo- ) )
531
+ Musee Ullah (
[ @lae ] ( https://github.com/lae ) ,
< [email protected] > )
532
+ Engin Dumlu ([ @roadrunner ] ( https://github.com/roadrunner ) )
533
+ Jonas Meurer ([ @mejo- ] ( https://github.com/mejo- ) )
534
+ Ondrej Flider ([ @SniperCZE ] ( https://github.com/SniperCZE ) )
535
+ niko2 ([ @niko2 ] ( https://github.com/niko2 ) )
536
+ Christian Aublet ([ @caublet ] ( https://github.com/caublet ) )
537
+ Fabien Brachere ([ @Fbrachere ] ( https://github.com/Fbrachere ) )
473
538
474
- [ pve-cluster ] : https://pve.proxmox.com/wiki/Proxmox_VE_4.x_Cluster
539
+ [ pve-cluster ] : https://pve.proxmox.com/wiki/Cluster_Manager
475
540
[ install-ansible ] : http://docs.ansible.com/ansible/intro_installation.html
476
541
[ pvecm-network ] : https://pve.proxmox.com/pve-docs/chapter-pvecm.html#_separate_cluster_network
477
542
[ user-module ] : https://github.com/lae/ansible-role-proxmox/blob/master/library/proxmox_user.py
478
543
[ group-module ] : https://github.com/lae/ansible-role-proxmox/blob/master/library/proxmox_group.py
479
544
[ acl-module ] : https://github.com/lae/ansible-role-proxmox/blob/master/library/proxmox_group.py
545
+ [ storage-module ] : https://github.com/lae/ansible-role-proxmox/blob/master/library/proxmox_storage.py
0 commit comments