-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost.yml
56 lines (48 loc) · 1.52 KB
/
post.yml
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
---
#This is an empty file meant to be overridden by custom post
#configuration playbook
- hosts: localhost
gather_facts: no
- hosts: tester
gather_facts: yes
any_errors_fatal: true
tasks:
- block:
- name: ensure /etc/systemd/journald.conf.d exists
file:
path: '/etc/systemd/journald.conf.d'
state: directory
- name: configure systemd-journald to be persistent across reboots
blockinfile:
path: /etc/systemd/journald.conf.d/storage.conf
create: yes
block: |
[Journal]
Storage=persistent
- name: restart systemd-journald
service:
name: systemd-journald
state: restarted
become: true
- name: Update deployment information on hypervisor
hosts: hypervisor
gather_facts: yes
any_errors_fatal: true
vars_files:
- vars/hypervisor.yml
tasks:
- block:
- name: Get all deployments
set_fact:
deployments_info: "{{ deployments_info|default({})|combine(ansible_local.deployment_info)|combine( ansible_local.run ) }}"
when: ansible_local.deployment_info is defined
- name: Update deployment custom fact
template:
src: deployments.fact.j2
dest: "{{ custom_facts }}/deployment_info.fact"
mode: 0644
- name: Delete local fact for current deployment
file:
path: "{{ custom_facts }}/run.fact"
state: absent
when: provision.prefix is defined