Refactor common and bootstrap_puppet_infra_node roles

Moving the setup of Puppetlabs apt repo and installation
of puppet packages to common role.
The bootstrap_puppet_infra_node now only configures puppet.conf
and enables the puppet agent.
This commit is contained in:
Ricardo Carrillo Cruz 2015-08-27 10:30:43 +02:00
parent d7ed978ab2
commit 5cf27e411f
3 changed files with 11 additions and 16 deletions

View File

@ -1,7 +1,7 @@
---
# file: common.yml
- hosts: infra
gather_facts: no
gather_facts: yes
user: ubuntu
sudo: true
roles:

View File

@ -1,15 +1,4 @@
---
- name: Get deb package for Puppetlabs repository
get_url: >
url=https://apt.puppetlabs.com/puppetlabs-release-{{ansible_distribution_release}}.deb
dest=/tmp/puppetlabs-release-{{ansible_distribution_release}}.deb
- name: Install Puppetlabs repository deb package
apt: deb=/tmp/puppetlabs-release-{{ansible_distribution_release}}.deb
- name: Install Puppet package after updating cache
apt: name=puppet update_cache=yes
- name: Deploy /etc/puppet.conf template
template: src=puppet.conf.j2 dest=/etc/puppet/puppet.conf
@ -18,6 +7,3 @@
- name: Enable puppet agent, as it is disabled upon installation
command: puppet agent --enable
- name: Run puppet agent to apply configuration
puppet:

View File

@ -1,9 +1,18 @@
---
- name: Get deb package for Puppetlabs repository
get_url: >
url=https://apt.puppetlabs.com/puppetlabs-release-{{ansible_distribution_release}}.deb
dest=/tmp/puppetlabs-release-{{ansible_distribution_release}}.deb
- name: Install Puppetlabs repository deb package
apt: deb=/tmp/puppetlabs-release-{{ansible_distribution_release}}.deb
- name: Update packages
apt: update_cache=yes
- name: Install git package
- name: Install Puppet and other required packages
apt: name={{ item }} state=installed
with_items:
- git
- python-pip
- puppet