Skip to content

Commit

Permalink
Merge pull request #60 from trickert76:feature/proxmox6_support
Browse files Browse the repository at this point in the history
PVE 6 support
  • Loading branch information
lae committed Aug 4, 2019
2 parents 5613967 + 469bc8b commit 4b5a86d
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@

ansible.cfg
*.retry
/.project
/.pydevproject
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ cache:
matrix:
fast_finish: true
env:
- ANSIBLE_GIT_VERSION='devel' # 2.8.x development branch
- ANSIBLE_GIT_VERSION='devel' # 2.9.x development branch
- ANSIBLE_VERSION='<2.9.0' # 2.8.x
- 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";
else pip install "ansible${ANSIBLE_VERSION}"; fi;
pip install --pre ansible-lint; pip install jmespath
- ansible --version
- ansible-galaxy install lae.travis-lxc
- ansible-galaxy install lae.travis-lxc,v0.8.1
- 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
Expand Down
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ pve_ceph_crush_rules: []
# pve_ssl_certificate: "contents of certificate"
pve_cluster_enabled: no
pve_cluster_clustername: "{{ pve_group }}"
# PVE 5.x (Debian Stretch) clustering options
pve_cluster_ring0_addr: "{{ ansible_default_ipv4.address }}"
pve_cluster_bindnet0_addr: "{{ pve_cluster_ring0_addr }}"
# pve_cluster_ring1_addr: "another interface's IP address or hostname"
# pve_cluster_bindnet1_addr: "{{ pve_cluster_ring1_addr }}"
# PVE 6.x (Debian Buster) clustering options
pve_cluster_link0_addr: "{{ ansible_default_ipv4.address }}"
# pve_cluster_link1_addr: "another interface's IP address or hostname"
pve_datacenter_cfg: {}
pve_ssl_letsencrypt: false
pve_groups: []
Expand Down
30 changes: 30 additions & 0 deletions files/proxmox-ve-release-6.x.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBFvydv4BEACqs61eF4B+Zz9H0hKJS72SEofK2Gy6a5wZ/Hb4DrGbbfC6fjrO
b3r4ZrM7G355TD5He7qzcGrxJjgGwH+/w6xRyYliIzxD/lp8UJXcmiZHG+MYYJP6
q29NWrbEcqPo6onx2tzNytHIUysqUE+mghXtyMN7KUMip7bDAqx2L51CI180Giv1
wdKUBP2bgKVObyFzK46ZEMzyl2qr9raFnHA8oF1HZRkwwcfSD/dkY7oJvAO1pXgR
8PzcXnXjoRTCyWlYVZYn54y9OjnB+knN8BlSOLNdBkKZs74XyJ9JlQU9ZfzatXXE
hMxdDquIAg+g/W9rLpLz5XAGb2GSNvKrU5otjOdUOnD0k1MpFujsSzRWZCIRnywf
mQ/Lahgo4wYOrQLNGCNdvwMgbwcD9NRjQsPdja94wJNRsmbhFeAKPyF8p3lf9QUH
Y3Vn1iGI6ut7c3uqUv0lKvujroKNc/hFSgcn8bUB+x0OnKE3yEiiGsEyJHGxVhjy
3FsY/h1SNtM57Wwk9zxjNuqp66jZcTu8foLNh6Ct+mFsor2Y6MxKVJvrcb9rXv54
YpQAZUjvZK5gnqOWTWrEZkjtNLoGiyuWOU+2RoqTtRA22u9Vlm5C/lduGC7akbVG
Xd8ocDrq4t5IyM3bqF3oru7zGW0hQgsPwbkQcfOawFkQlGEDzf1TrXTafwARAQAB
tElQcm94bW94IFZpcnR1YWwgRW52aXJvbm1lbnQgNi54IFJlbGVhc2UgS2V5IDxw
cm94bW94LXJlbGVhc2VAcHJveG1veC5jb20+iQJUBBMBCAA+FiEENTR5+DeB1/jt
X1rFe/KBLopuiOAFAlvydv4CGwMFCRLMAwAFCwkIBwIGFQgJCgsCBBYCAwECHgEC
F4AACgkQe/KBLopuiODQZRAAo0kXc090pNskVDr0qB7T2x8UShxvC5E6imZHASq/
ui1wd5Wei+WkPj4ME/1yAvpMrMAq3LbbIgmHbBqzsagQaeL88vWn5c0NtzsrzHoU
+ql5XrCnbnmXBoCGUgiXA3vq0FaemTzfCBGnHPbsOoPlvHZjXPvpnMOomO39o1xa
w2Ny8fhhv651CjPpK7DQF5KoMm3LdjXB6nouErJJZDvUaNmGNhHh4HzWiOSLyaE8
T0UsUR1HqGkzvgE2OuwPjeWFIIRPKeiCFbA+mlEfwb/Lgu6F4D6IsP++ItuG6Q6Y
jAopuK7QXrnFpDfAZmQsbsOgkqqg5dy7xBJATuCPkUk9qMBaeLVqkANq1OlZksPT
ry2399U83i69xsJNW4BBC0JXKWWJpq5d9ZH05OP9wxYR2+K3Hmh4vvkzcgoMEbnF
rFzpH+eGkWxxZS1AGhMJBXGkmm1eW7ZFQVx6o0w9dWRRqDo7UklVNPImtXuso3nI
wuYF0+Dv6PeE8EQWLp4FQGHlaEoUmYFug4xiWF1tCcW6UWy6fEhVAcXbbD0IvUjS
6pL9IKpyOWDJBV0Tya4LmBAzaPB7ljYfEBASvaPVKDcSva6wEM8/vA6Oal2/LVdQ
8TG5eRrtWxeZxZSQknv0v3IhPujyP9dxvhJfZmVZKQx/oPgEWFmGuQ8ggXtNZL/8
72I=
=ssmE
-----END PGP PUBLIC KEY BLOCK-----
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ galaxy_info:
- name: Debian
versions:
- stretch
- buster

galaxy_tags:
- proxmox
Expand Down
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
filename: pve-enterprise
state: absent
with_items:
- "deb https://enterprise.proxmox.com/debian stretch pve-enterprise"
- "deb https://enterprise.proxmox.com/debian/pve stretch pve-enterprise"
- "deb https://enterprise.proxmox.com/debian {{ ansible_distribution_release }} pve-enterprise"
- "deb https://enterprise.proxmox.com/debian/pve {{ ansible_distribution_release }} pve-enterprise"

- name: Remove subscription check wrapper function in web UI
patch:
Expand Down
16 changes: 14 additions & 2 deletions tasks/pve_add_node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,26 @@
_pve_current_node: "{{ item }}"

- name: Add node to Proxmox cluster
command: "pvecm add {{ hostvars[groups[pve_group][0]]['ansible_default_ipv4']['address'] }}\
{{ ' -use_ssh' if ansible_distribution_release == 'stretch' else '' }} \
command: "pvecm add {{ hostvars[groups[pve_group][0]]['ansible_default_ipv4']['address'] }} \
-use_ssh \
-ring0_addr {{ pve_cluster_ring0_addr }}{% if pve_cluster_ring1_addr is defined %} \
-ring1_addr {{ pve_cluster_ring1_addr }}{% endif %}"
args:
creates: "{{ pve_cluster_conf }}"
when:
- "inventory_hostname == _pve_current_node"
- "ansible_distribution_release == 'stretch'"

- name: Add node to Proxmox cluster
command: "pvecm add {{ hostvars[groups[pve_group][0]]['ansible_default_ipv4']['address'] }} \
-use_ssh \
-link0 {{ pve_cluster_link0_addr }}{% if pve_cluster_link1_addr is defined %} \
-link1 {{ pve_cluster_link1_addr }}{% endif %}"
args:
creates: "{{ pve_cluster_conf }}"
when:
- "inventory_hostname == _pve_current_node"
- "ansible_distribution_release == 'buster'"

- name: Remove stale corosync lock file due to lack of quorum during initialization
file:
Expand Down
13 changes: 13 additions & 0 deletions tasks/pve_cluster_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@
when:
- "_pve_found_clusters is not defined"
- "inventory_hostname == groups[pve_group][0]"
- "ansible_distribution_release == 'stretch'"

- name: Initialize a Proxmox cluster
command: "pvecm create {{ pve_cluster_clustername }} \
-link0 {{ pve_cluster_link0_addr }}\
{% if pve_cluster_link1_addr is defined %} \
-link1 {{ pve_cluster_link1_addr }}{% endif %}"
args:
creates: "{{ pve_cluster_conf }}"
when:
- "_pve_found_clusters is not defined"
- "inventory_hostname == groups[pve_group][0]"
- "ansible_distribution_release == 'buster'"

- name: Wait for quorum on initialization node
proxmox_query:
Expand Down
2 changes: 1 addition & 1 deletion tests/group_vars/all
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
ansible_ssh_user: root

pve_group: pve
pve_group: "{{ ansible_distribution_release }}cluster"
pve_extra_packages:
- sl
pve_check_for_kernel_update: false
Expand Down
2 changes: 2 additions & 0 deletions tests/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
shell: "openssl req -x509 -new -nodes -key {{ ssl_ca_key_path }} -sha256 -days 1 -subj '{{ ssl_subj }}' -out {{ ssl_ca_cert_path }}"
vars:
test_profiles:
- profile: debian-buster
prefix: proxmox-6-
- profile: debian-stretch
prefix: proxmox-5-
test_hosts_per_profile: 3
Expand Down
5 changes: 4 additions & 1 deletion tests/inventory
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[pve]
[stretchcluster]
proxmox-5-[01:03].lxc

[bustercluster]
proxmox-6-[01:03].lxc
4 changes: 4 additions & 0 deletions vars/debian-buster.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
pve_release_key: proxmox-ve-release-6.x.asc
pve_release_key_id: 7BF2812E8A6E88E0
pve_ssh_ciphers: "aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com"

0 comments on commit 4b5a86d

Please sign in to comment.