-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathplaybook-bootstrap.yaml
More file actions
70 lines (66 loc) · 2.34 KB
/
Copy pathplaybook-bootstrap.yaml
File metadata and controls
70 lines (66 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
# TODO: now that this is sorta the "initialize everything" playbook it should probably be renamed
- name: Bootstrap for Ansible
hosts: all
gather_facts: false
roles:
- role: usegalaxy_org.bootstrap
- name: Bootstrap additional
hosts: all
pre_tasks:
- name: Group by OS Family
ansible.builtin.group_by:
key: "group_by_{{ ansible_os_family | lower }}"
changed_when: false
- name: Group by Distribution
ansible.builtin.group_by:
key: "group_by_{{ ansible_distribution | lower }}"
changed_when: false
# TODO: 2026-05 SmartOS AlmaLinux 9 images are shipping with an empty /etc/hosts
- name: Check /etc/hosts
ansible.builtin.stat:
path: /etc/hosts
register: etc_hosts_stat
tags: pre
- name: Populate /etc/hosts if it exists but is empty
ansible.builtin.copy:
dest: /etc/hosts
content: |
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
owner: root
group: root
mode: '0644'
when:
- etc_hosts_stat.stat.exists
- etc_hosts_stat.stat.size == 0
roles:
- role: galaxyproject.general.virtual
when: "'virtual_hosts' in group_names"
- role: galaxyproject.general.locale
- role: galaxyproject.general.login_defs
- role: galaxyproject.general.packages
- role: galaxyproject.general.users
- role: galaxyproject.general.paths
# NOTE: if this ends up being problematic, you could pass a `copy_inheritance_chain` var in other playbooks that
# need to do a late copy that sets the inheritance chain keys to `late_templates` and `late_files`
- role: galaxyproject.general.copy
- role: galaxyproject.general.cron
tags: system
- name: Install telegraf
hosts: telegraf_agents
pre_tasks:
# FIXME: see FIXME comment in group_vars/telegraf_agents/vars.yaml
- name: Remove conflicting telegraf sources.list
ansible.builtin.file:
path: /etc/apt/sources.list.d/telegraf.list
state: absent
when: ansible_os_family == "Debian" and telegraf_agent_package_method == "manual"
roles:
- role: dj-wasabi.telegraf
tags: telegraf
- name: Install postfix
hosts: postfix_clients
roles:
- role: galaxyproject.postfix
tags: postfix