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 745913a3c2
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
1 changed files with 5 additions and 2 deletions

View File

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