mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2026-05-04 16:39:50 +02:00
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
- name: Install puppet agent
|
||||
become: "{{ false if inventory_hostname == 'nas.home.lan' else true }}"
|
||||
vars:
|
||||
puppet_server: active.home.lan
|
||||
block:
|
||||
# - name: Ensure Puppet repo is present (Debian/Ubuntu)
|
||||
# apt_repository:
|
||||
# repo: "deb http://apt.puppetlabs.com {{ ansible_distribution_release }} puppet6"
|
||||
# state: present
|
||||
# when: ansible_os_family == "Debian"
|
||||
- name: Facts
|
||||
ansible.builtin.setup:
|
||||
when: ansible_facts.architecture is not defined
|
||||
- name: Install Puppet agent package
|
||||
package:
|
||||
name: puppet-agent
|
||||
state: present
|
||||
|
||||
- name: Create Puppet configuration directory
|
||||
file:
|
||||
path: /etc/puppetlabs/puppet
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Deploy puppet.conf
|
||||
template:
|
||||
src: puppet.conf.j2
|
||||
dest: /etc/puppet/puppet.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
- name: Enable and start puppet agent
|
||||
systemd:
|
||||
name: puppet
|
||||
enabled: true
|
||||
state: started
|
||||
|
||||
- name: Trigger puppet agent run once1
|
||||
command: /usr/bin/puppet agent -t
|
||||
register: puppet_run
|
||||
ignore_errors: true
|
||||
|
||||
- debug:
|
||||
var: puppet_run.stdout_lines
|
||||
Reference in New Issue
Block a user