
Infra has adopted the approach of indenting lists an extra level instead of starting their '-' at the same level as the parent element. Additionally, Infra uses .yaml extensions instead of .yml extensions. This role predates Infra having enough ansible to have opinions, so update it to match current practice. Also, while we're in there, update when clauses that have an 'and' in them to just use the list form of when, and change 'include:' to 'include_tasks:'. Change-Id: Icbeaf99c4d103091ee094e2fa219d7e16229b998
59 lines
1.5 KiB
YAML
59 lines
1.5 KiB
YAML
- name: Set puppet conf dir
|
|
set_fact:
|
|
puppet_confdir: "{{ '/etc/puppet' if puppet_version == '3' else '/etc/puppetlabs/puppet' }}"
|
|
|
|
- name: Set puppet code dir
|
|
set_fact:
|
|
puppet_codedir: "{{ '/etc/puppet' if puppet_version == '3' else '/etc/puppetlabs/code' }}"
|
|
|
|
- name: Enable puppet environments explicitly for puppet 3
|
|
set_fact:
|
|
puppet_environmentpath: '$confdir/environments'
|
|
when:
|
|
- puppet_version == '3'
|
|
- puppet_environmentpath == ''
|
|
|
|
# Create our config
|
|
- name: Create puppet.conf from template
|
|
template:
|
|
src: "puppet.conf.j2"
|
|
dest: "{{ puppet_confdir }}/puppet.conf"
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
|
|
- name: Create hiera.yaml from template
|
|
template:
|
|
src: "hiera.yaml.j2"
|
|
dest: "{{ puppet_confdir }}/hiera.yaml"
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
|
|
- name: symlink hiera config files together
|
|
file:
|
|
src: "{{ puppet_confdir }}/hiera.yaml"
|
|
dest: "/etc/hiera.yaml"
|
|
owner: root
|
|
group: root
|
|
state: link
|
|
force: yes
|
|
|
|
- name: create environment directory
|
|
file:
|
|
path: "{{ puppet_codedir }}/environments/{{ puppet_environment }}"
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: 0755
|
|
when: puppet_environment is defined
|
|
|
|
- name: create environment.conf from template
|
|
template:
|
|
src: "environment.conf.j2"
|
|
dest: "{{ puppet_codedir }}/environments/{{ puppet_environment }}/environment.conf"
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
when: puppet_environment is defined
|