diff --git a/common.yml b/common.yml index 91859b8..9f0d624 100644 --- a/common.yml +++ b/common.yml @@ -1,7 +1,7 @@ --- # file: common.yml - hosts: infra - gather_facts: no + gather_facts: yes user: ubuntu sudo: true roles: diff --git a/roles/bootstrap_puppet_infra_node/tasks/main.yml b/roles/bootstrap_puppet_infra_node/tasks/main.yml index 8664f64..754bdb3 100644 --- a/roles/bootstrap_puppet_infra_node/tasks/main.yml +++ b/roles/bootstrap_puppet_infra_node/tasks/main.yml @@ -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: diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index af1e6b6..c3561db 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -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