Allow setting puppet_version explicitly

If we set puppet_version as an inventory variable, then we can drive
behavior from that variable, including updating puppet. Add the ability
to set it here. A followup change in system-config will start setting
it, but starting off it should be a no-op.

Change-Id: I773ba3a2137b62ae2b3440dd02b3cdfb2099a62d
This commit is contained in:
Monty Taylor 2018-08-11 07:03:12 -05:00
parent 92d5d596b9
commit 9ce65b14fc
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
1 changed files with 2 additions and 0 deletions

View File

@ -26,10 +26,12 @@
shell:
cmd: "PATH=$PATH:/opt/puppetlabs/bin puppet --version | cut -d '.' -f 1"
register: puppet_version
when: puppet_version is not defined
- name: Set puppet version fact
set_fact:
puppet_version: "{{ puppet_version.stdout }}"
when: puppet_version is not defined
- name: Sanity check puppet version
fail: "Unsupported puppet version {{ puppet_version }}"