mirror of
https://github.com/krislamo/pup-tests
synced 2025-09-08 07:49:28 +00:00
Setup Puppet Environment
Ansible sets up a puppet master and puppet agent on two virtual machines with a hello world puppet application.
This commit is contained in:
26
setup/roles/client/tasks/main.yml
Normal file
26
setup/roles/client/tasks/main.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
- name: Install Puppet Agent
|
||||
apt: name=puppet state=present
|
||||
register: agent_install
|
||||
|
||||
- name: Deploy puppet.conf
|
||||
template:
|
||||
src: puppet.conf.j2
|
||||
dest: /etc/puppet/puppet.conf
|
||||
|
||||
- name: Start Puppet
|
||||
service: name=puppet state=started
|
||||
|
||||
- name: Wait for Puppet Master
|
||||
wait_for:
|
||||
host: puppet
|
||||
port: 8140
|
||||
delay: 10
|
||||
when: agent_install.changed
|
||||
|
||||
- name: Request Puppet Master
|
||||
command: puppet agent -t
|
||||
register: send_csr
|
||||
failed_when: send_csr.rc > 1
|
||||
when: agent_install.changed
|
||||
become_user: vagrant
|
||||
|
6
setup/roles/client/templates/puppet.conf.j2
Normal file
6
setup/roles/client/templates/puppet.conf.j2
Normal file
@@ -0,0 +1,6 @@
|
||||
[main]
|
||||
ssldir = /var/lib/puppet/ssl
|
||||
|
||||
[agent]
|
||||
server = puppet
|
||||
|
Reference in New Issue
Block a user