Skip to content

Commit

Permalink
Release 1.5.0
Browse files Browse the repository at this point in the history
Merge branch 'develop' into master
  • Loading branch information
lae committed May 15, 2019
2 parents 0afc625 + b1ea429 commit 3d188ec
Show file tree
Hide file tree
Showing 27 changed files with 613 additions and 218 deletions.
23 changes: 10 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,21 @@ cache:
matrix:
fast_finish: true
env:
- ANSIBLE_GIT_VERSION='devel' # 2.6.x development branch
- ANSIBLE_VERSION='<2.6.0' # 2.5.x
- ANSIBLE_VERSION='<2.5.0' # 2.4.x
- ANSIBLE_GIT_VERSION='devel' # 2.8.x development branch
- ANSIBLE_VERSION='<2.8.0' # 2.7.x
- ANSIBLE_VERSION='<2.7.0' # 2.6.x
install:
- if [ "$ANSIBLE_GIT_VERSION" ]; then pip install "https://github.com/ansible/ansible/archive/${ANSIBLE_GIT_VERSION}.tar.gz";
elif [ "$ANSIBLE_VERSION" ]; then pip install "ansible${ANSIBLE_VERSION}";
else pip install ansible; fi;
pip install jmespath
else pip install "ansible${ANSIBLE_VERSION}"; fi;
pip install --pre ansible-lint; pip install jmespath
- ansible --version
# The following is needed for default Ansible 2.3 installations
- 'sudo mkdir -p /etc/ansible/roles && sudo chown $(whoami): /etc/ansible/roles'
- ansible-galaxy install lae.travis-lxc
- ansible-playbook tests/install.yml -i tests/inventory
- git archive --format tar.gz HEAD > lae.proxmox.tar.gz && ansible-galaxy install
lae.proxmox.tar.gz,$(git rev-parse HEAD),lae.proxmox && rm lae.proxmox.tar.gz
before_script: cd tests/
script:
- ansible-lint ../ || true
- ansible-playbook -i inventory deploy.yml --syntax-check
- ansible-playbook -i inventory -v deploy.yml --skip skiponlxc
- 'ANSIBLE_STDOUT_CALLBACK=debug unbuffer ansible-playbook --skip skiponlxc -vv
Expand All @@ -33,8 +31,7 @@ script:
(echo "Idempotence: PASS"; exit 0) || (echo "Idempotence: FAIL"; exit 1)'
- ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook -i inventory -v test.yml
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
irc:
on_success: change
channels:
secure: "uNnWy3ToabL7W4mP2jTqdbV3do408Sl4N53D9T3vvcpCOLrdHeSagq+Juto3q4Z2bF/zpwHp05y5pJU0N3Fsb4W1C2jUnGvbwEYFRK+cTUsMUT+rrcHByF2e/nMBi1GEPysGfXtNMlEIe+rlKNTCFvfngnp2lTmcs4QBtQh+eS1YQBr8mdizCDWi28FygMTma87VdQ10Af0XkXWHgVHYfh4MARGfkMmCWjZqBHaKV5xTZ7xVzndGN7T3XiehRnD44iQNT6PaYZFRqUWV8S8BROhwOZIlgwEX3t/gxiGKLOHoI/cubm2H8aKEhSMl18MUZxET7CK4vwVpEnlqTQihsLkkuM7zfvsUWEQA03ZsZDAAnnIykbfQDMVBexOfZwv/5xdX5qTy2aghr7c/+LUf8N86Hj+TDGfWBioNhuPYBj5lghw0a+p002kKjjmgr2tTZpghIdHzmRqjne2ZbcIH3lBMWftzDHtBxuUTAaxaGP75VqH0JF5lGUvZL49VPtb8tGff0BVi0+YuHdlDAoIL6ACC6qQlgyVEZhZ170QS0Ez9s+pkMa1rpj4BsxBKZog3TKEad4K+CcewarwCgCEGxG2S4E1ugeZoCVtP8Gr4CC/51axhbATCPqYSQnNXKXo6vP3Gw3VBOcKx/Ku8uR+Kcdj7oEoAcJRF5eZFMG1y5Wk="
webhooks:
urls:
- https://galaxy.ansible.com/api/v1/notifications/
- https://t2d.idolactiviti.es/notify
84 changes: 75 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ lae.proxmox
Installs and configures a Proxmox 5.x cluster with the following features:

- Ensures all hosts can connect to one another as root
- Ability to create/manage groups, users, and access control lists
- Ability to create/manage groups, users, access control lists and storage
- Ability to create or add nodes to a PVE cluster
- IPMI watchdog support
- BYO HTTPS certificate support
Expand Down Expand Up @@ -46,8 +46,6 @@ Copy the following playbook to a file like `install_proxmox.yml`:

Install this role and a role for configuring NTP:

# Changing ownership of the roles directory may be necessary:
sudo chown $(whoami): /etc/ansible/roles
ansible-galaxy install lae.proxmox geerlingguy.ntp

Now you can perform the installation:
Expand All @@ -64,6 +62,11 @@ file containing a list of hosts).
Once complete, you should be able to access your Proxmox VE instance at
`https://$SSH_HOST_FQDN:8006`.

## Support/Contributing

For support or if you'd like to contribute to this role but want guidance, feel
free to join this Discord server: https://discord.gg/cjqr6Fg

## Deploying a fully-featured PVE 5.x cluster

Create a new playbook directory. We call ours `lab-cluster`. Our playbook will
Expand Down Expand Up @@ -167,6 +170,13 @@ pve_acls:
- path: /
roles: [ "Administrator" ]
groups: [ "ops" ]
pve_storages:
- name: localdir
type: dir
content: [ "images", "iso", "backup" ]
path: /plop
maxfiles: 4
interfaces_template: "interfaces-{{ pve_group }}.j2"
```

Expand Down Expand Up @@ -201,6 +211,10 @@ are already in existing clusters with different names.
must already exist) to access PVE and gives them the Administrator role as part
of the `ops` group. Read the **User and ACL Management** section for more info.

`pve_storages` allows to create different types of storage and configure them.
The backend needs to be supported by [Proxmox](https://pve.proxmox.com/pve-docs/chapter-pvesm.html).
Read the **Storage Management** section for more info.

`interfaces_template` is set to the path of a template we'll use for configuring
the network on these Debian machines. This is only necessary if you want to
manage networking from Ansible rather than manually or via each host in PVE.
Expand Down Expand Up @@ -266,7 +280,7 @@ Finally, let's write our playbook. `site.yml` will look something like this:
template:
src: "{{ interfaces_template }}"
dest: /etc/network/interfaces
register: __configure_interfaces
register: _configure_interfaces
- block:
- name: Reboot for networking changes
Expand All @@ -277,7 +291,7 @@ Finally, let's write our playbook. `site.yml` will look something like this:
- name: Wait for server to come back online
wait_for_connection:
delay: 15
when: __configure_interfaces is changed
when: _configure_interfaces is changed
- hosts: pve
become: True
Expand Down Expand Up @@ -362,6 +376,7 @@ pve_repository_line: "deb http://download.proxmox.com/debian/pve stretch pve-no-
pve_remove_subscription_warning: true # patches the subscription warning messages in proxmox if you are using the community edition
pve_extra_packages: [] # Any extra packages you may want to install, e.g. ngrep
pve_run_system_upgrades: false # Let role perform system upgrades
pve_run_proxmox_upgrades: true # Let role perform Proxmox VE upgrades
pve_check_for_kernel_update: true # Runs a script on the host to check kernel versions
pve_reboot_on_kernel_update: false # If set to true, will automatically reboot the machine on kernel updates
pve_remove_old_kernels: true # Currently removes kernel from main Debian repository
Expand All @@ -376,6 +391,7 @@ pve_zfs_enabled: no # Specifies whether or not to install and configure ZFS pack
pve_ssl_letsencrypt: false # Specifies whether or not to obtain a SSL certificate using Let's Encrypt
pve_groups: [] # List of group definitions to manage in PVE. See section on User Management.
pve_users: [] # List of user definitions to manage in PVE. See section on User Management.
pve_storages: [] # List of storages to manage in PVE. See section on Storage Management.
```

To enable clustering with this role, configure the following variables appropriately:
Expand Down Expand Up @@ -465,15 +481,65 @@ pve_acls:

Refer to `library/proxmox_acl.py` [link][acl-module] for module documentation.

## Storage Management

You can use this role to manage storage within Proxmox VE (both in
single server deployments and cluster deployments). For now, the only supported
types are `dir`, `rbd`, `nfs`, `lvm` and `lvmthin`.
Here are some examples.

```
pve_storages:
- name: dir1
type: dir
content: [ "images", "iso", "backup" ]
path: /ploup
disable: no
maxfiles: 4
- name: ceph1
type: rbd
content: [ "images", "rootdir" ]
nodes: [ "lab-node01.local", "lab-node02.local" ]
username: admin
pool: rbd
krbd: yes
monhost:
- 10.0.0.1
- 10.0.0.2
- 10.0.0.3
- name: nfs1
type: nfs
content: [ "images", "iso" ]
server: 192.168.122.2
export: /data
- name: lvm1
type: lvm
content: [ "images", "rootdir" ]
vgname: vg1
- name: lvmthin1
type: lvmthin
content: [ "images", "rootdir" ]
vgname: vg2
thinpool: data
```

Refer to `library/proxmox_storage.py` [link][storage-module] for module
documentation.

## Contributors

Musee Ullah ([@lae](https://github.com/lae), <lae@lae.is>)
Engin Dumlu ([@roadrunner](https://github.com/roadrunner))
Jonas Meurer ([@mejo-](https://github.com/mejo-))
Musee Ullah ([@lae](https://github.com/lae), <lae@lae.is>)
Engin Dumlu ([@roadrunner](https://github.com/roadrunner))
Jonas Meurer ([@mejo-](https://github.com/mejo-))
Ondrej Flider ([@SniperCZE](https://github.com/SniperCZE))
niko2 ([@niko2](https://github.com/niko2))
Christian Aublet ([@caublet](https://github.com/caublet))
Fabien Brachere ([@Fbrachere](https://github.com/Fbrachere))

[pve-cluster]: https://pve.proxmox.com/wiki/Proxmox_VE_4.x_Cluster
[pve-cluster]: https://pve.proxmox.com/wiki/Cluster_Manager
[install-ansible]: http://docs.ansible.com/ansible/intro_installation.html
[pvecm-network]: https://pve.proxmox.com/pve-docs/chapter-pvecm.html#_separate_cluster_network
[user-module]: https://github.com/lae/ansible-role-proxmox/blob/master/library/proxmox_user.py
[group-module]: https://github.com/lae/ansible-role-proxmox/blob/master/library/proxmox_group.py
[acl-module]: https://github.com/lae/ansible-role-proxmox/blob/master/library/proxmox_group.py
[storage-module]: https://github.com/lae/ansible-role-proxmox/blob/master/library/proxmox_storage.py
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pve_check_for_kernel_update: true
pve_reboot_on_kernel_update: false
pve_remove_old_kernels: true
pve_run_system_upgrades: false
pve_run_proxmox_upgrades: true
pve_watchdog: none
pve_watchdog_ipmi_action: power_cycle
pve_watchdog_ipmi_timeout: 10
Expand All @@ -27,3 +28,4 @@ pve_ssl_letsencrypt: false
pve_groups: []
pve_users: []
pve_acls: []
pve_storages: []
File renamed without changes.
75 changes: 0 additions & 75 deletions files/00_remove_checked_command_jessie.patch

This file was deleted.

30 changes: 0 additions & 30 deletions files/proxmox-ve-release-4.x.asc

This file was deleted.

Loading

0 comments on commit 3d188ec

Please sign in to comment.