forked from zerwes/ansible-fqcn-converter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
exampleconverted.yml
145 lines (125 loc) · 3.14 KB
/
exampleconverted.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
---
- name: ansible fqcn test playbook
hosts: localhost
gather_facts: true
vars:
xyz: abc
num: 1
deploy: true
domain: example.com
tasks:
- name: test task 1
ansible.builtin.command: cat dog
- name: test task 2
ansible.builtin.command:
cmd: cat dog
- name: test task 1 fqcn
ansible.builtin.command: cat dog
- name: test task 2 fqcn
ansible.builtin.command:
cmd: cat dog
- name: assert
ansible.builtin.assert:
that: true
- ansible.builtin.assert:
that: not false
- name: roles
collections:
- 'debops.debops'
- 'debops.roles01'
- 'debops.roles02'
- 'debops.roles03'
roles:
- role: bootstrap
tags:
- bootstrap
- role: common
tags:
- common
---
# just tasks list
# named task
- name: test apt unnamed
ansible.builtin.apt:
name: ipsum
# named task w/ group as pitfall
- name: test copy with group as pitfall
ansible.builtin.copy:
content: aaa
dest: xyz
group: lorem
# galaxy module
- name: general command os6_config
dellemc.os6.os6_config:
commands: "{{ dellos_general_command | default([]) }}"
when: ansible_network_os == "dellemc.os6.os6"
# this will be ignored due to cfg
- name: general command os10_config
os10_config:
commands: "{{ dellos_general_command | default([]) }}"
# unnamed task
- ansible.builtin.file:
path: /etc/apt/sources.list.d/pve-enterprise.list
state: absent
when: "'ox' in group_names"
# unnamed fqcn
- ansible.builtin.copy:
src: a
dest: b
# named fqcn
- name: lorem ipsum
ansible.builtin.copy:
src: lorem
dest: ipsum
# issue #11 check double colon
- name: update mysql root password for all root accounts
community.mysql.mysql_user:
name: root
host: "{{ item }}"
password: "{{ mysql_root_password }}"
with_items:
- "{{ inventory_hostname_short }}"
- 127.0.0.1
- ::1
ignore_errors: true
run_once: true
# block
- name: "configure ..."
block:
- name: "read ..."
ansible.builtin.command: cat dog
become: true
check_mode: false
changed_when: false
register: _local_json
- name: read json
ansible.builtin.set_fact:
current_of_local_json: "{{ _local_json.stdout | from_json }}"
- name: "write {{ of_default_config }}"
ansible.builtin.copy:
dest: "{{ of_default_config }}"
content: "{{ current_of_local_json | combine(of_local_json, recursive=true) | to_nice_json(indent=2, sort_keys=false) }}\n"
notify: restart-xyz
when: of_local_json
- name: test user ... expect buildin
ansible.builtin.user:
name: test
password: '!'
- name: test issue 18
ansible.builtin.command: echo "expect no openstack.cloud.config:system:set here"
with_items:
- app:disable dashboard
- config:system:set a b
- no:such:xxx
- name: test issue 22 - systemd
ansible.builtin.systemd_service:
name: systemd-timesyncd
enabled: false
state: stopped
masked: true
- name: test issue 22 - systemd_service
ansible.builtin.systemd_service:
name: systemd-timesyncd
enabled: false
state: stopped
masked: true