58 lines
1.7 KiB
YAML
58 lines
1.7 KiB
YAML
- fail:
|
|
msg: "Unsupported puppet version '{{ puppet_install_version }}' on this platform"
|
|
when: puppet_install_version not in [3, 4]
|
|
|
|
- name: Install puppet 3 packages
|
|
when: puppet_install_version == 3
|
|
become: true
|
|
block:
|
|
# Note https doesn't work here due to certificate issues and
|
|
# python versions and SNI etc; not worth the effort of workarounds
|
|
# at this point.
|
|
- name: Install puppetlabs repo
|
|
apt:
|
|
deb: http://apt.puppetlabs.com/puppetlabs-release-trusty.deb
|
|
|
|
- name: Install puppet packages
|
|
package:
|
|
state: present
|
|
name:
|
|
- puppet
|
|
- ruby
|
|
|
|
- name: Install puppet 4 packages
|
|
when: puppet_install_version == 4
|
|
become: true
|
|
block:
|
|
|
|
# The puppetlabs-release-pc1 deb install below unfortunatley isn't
|
|
# idempotent. If you install the puppet repo with this deb and
|
|
# then upgrade, you pull in a new version of
|
|
# puppetlabs-release-pc1 ... now ansible gets upset because we're
|
|
# trying to downgrade the package. This could be fixed by puppet
|
|
# symlinking the version at the top-level to the latest .deb
|
|
# ... or we just skip installing it if we seem to have the repo
|
|
# already.
|
|
- name: "Check for puppet 4 repo"
|
|
stat:
|
|
path: /etc/apt/sources.list.d/puppetlabs-pc1.list
|
|
register: puppet4_repo
|
|
- name: Install puppetlabs repo
|
|
apt:
|
|
deb: http://apt.puppetlabs.com/puppetlabs-release-pc1-trusty.deb
|
|
when: not puppet4_repo.stat.exists
|
|
|
|
- name: Install puppet packages
|
|
apt:
|
|
name:
|
|
- puppet-agent
|
|
- ruby
|
|
update_cache: yes
|
|
|
|
- name: Stop and disable puppet service
|
|
service:
|
|
name: puppet
|
|
state: stopped
|
|
enabled: no
|
|
become: yes
|