Skip to content

Commit 2e92551

Browse files
committed
Fix yamllint
1 parent fa13944 commit 2e92551

File tree

10 files changed

+304
-304
lines changed

10 files changed

+304
-304
lines changed

2-ansible/03-playbook/install-nginx.yaml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,30 @@
44
hosts: ubuntu
55
become: true
66
tasks:
7-
- name: "Install Nginx"
8-
apt:
9-
name: nginx
10-
state: present
11-
update_cache: true
7+
- name: "Install Nginx"
8+
apt:
9+
name: nginx
10+
state: present
11+
update_cache: true
1212

13-
- name: "Ensure nginx service started"
14-
service:
15-
name: nginx
16-
state: started
13+
- name: "Ensure nginx service started"
14+
service:
15+
name: nginx
16+
state: started
1717

1818
- name: Install Nginx on Amazon Linux
1919
hosts: amazon
2020
become: true
2121
tasks:
22-
- name: "Enable Nginx repository provided by Amazon"
23-
command: "amazon-linux-extras enable nginx1"
22+
- name: "Enable Nginx repository provided by Amazon"
23+
command: "amazon-linux-extras enable nginx1"
2424

25-
- name: "Install Nginx"
26-
yum:
27-
name: nginx
28-
state: present
25+
- name: "Install Nginx"
26+
yum:
27+
name: nginx
28+
state: present
2929

30-
- name: "Ensure nginx service started"
31-
service:
32-
name: nginx
33-
state: started
30+
- name: "Ensure nginx service started"
31+
service:
32+
name: nginx
33+
state: started

2-ansible/03-playbook/syntax.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,28 @@
1010
- name: Play 1
1111
hosts: ubuntu
1212
tasks:
13-
- name: "Task 1: Execute command"
14-
command: uptime
13+
- name: "Task 1: Execute command"
14+
command: uptime
1515

16-
- name: "Task 2: Execute script"
17-
script: task2.sh
16+
- name: "Task 2: Execute script"
17+
script: task2.sh
1818

19-
- name: "Task 3: Install package"
20-
apt:
21-
name: nginx
22-
state: present
23-
update_cache: true
19+
- name: "Task 3: Install package"
20+
apt:
21+
name: nginx
22+
state: present
23+
update_cache: true
2424

25-
- name: "Task 4: Start nginx service"
26-
service:
27-
name: nginx
28-
state: started
25+
- name: "Task 4: Start nginx service"
26+
service:
27+
name: nginx
28+
state: started
2929

3030
- name: Play 2
3131
hosts: localhost
3232
tasks:
33-
- name: "Task 1: Execute command"
34-
command: whoami
33+
- name: "Task 1: Execute command"
34+
command: whoami
3535

36-
- name: "Task 2: Execute script"
37-
script: task2.sh
36+
- name: "Task 2: Execute script"
37+
script: task2.sh

2-ansible/03-playbook/uninstall-nginx.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@
44
hosts: ubuntu
55
become: true
66
tasks:
7-
- name: "Ensure nginx service stopped"
8-
service:
9-
name: nginx
10-
state: stopped
7+
- name: "Ensure nginx service stopped"
8+
service:
9+
name: nginx
10+
state: stopped
1111

12-
- name: "Uninstall Nginx"
13-
apt:
14-
name: nginx
15-
state: absent
12+
- name: "Uninstall Nginx"
13+
apt:
14+
name: nginx
15+
state: absent
1616

1717
- name: Uninstall Nginx on Amazon Linux
1818
hosts: amazon
1919
become: true
2020
tasks:
21-
- name: "Ensure nginx service stopped"
22-
service:
23-
name: nginx
24-
state: stopped
21+
- name: "Ensure nginx service stopped"
22+
service:
23+
name: nginx
24+
state: stopped
2525

26-
- name: "Uninstall Nginx"
27-
yum:
28-
name: nginx
29-
state: absent
26+
- name: "Uninstall Nginx"
27+
yum:
28+
name: nginx
29+
state: absent
3030

31-
- name: "Disable Nginx repository provided by Amazon"
32-
command: "amazon-linux-extras disable nginx1"
31+
- name: "Disable Nginx repository provided by Amazon"
32+
command: "amazon-linux-extras disable nginx1"

2-ansible/04-module/example.yaml

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,47 @@
44
hosts: ubuntu
55
become: true
66
tasks:
7-
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/user_module.html
8-
- name: "Create a user"
9-
user: "name=fastcampus shell=/bin/bash"
7+
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/user_module.html
8+
- name: "Create a user"
9+
user: "name=fastcampus shell=/bin/bash"
1010

11-
- name: "Hello World"
12-
command: "echo 'Hello World!'"
11+
- name: "Hello World"
12+
command: "echo 'Hello World!'"
1313

14-
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html
15-
- name: "Add DNS server to resolv.conf"
16-
lineinfile:
17-
path: /etc/resolv.conf
18-
line: 'nameserver 8.8.8.8'
14+
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html
15+
- name: "Add DNS server to resolv.conf"
16+
lineinfile:
17+
path: /etc/resolv.conf
18+
line: 'nameserver 8.8.8.8'
1919

20-
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/apt_module.html
21-
- name: "Install Nginx"
22-
apt:
23-
name: nginx
24-
state: present
25-
update_cache: true
20+
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/apt_module.html
21+
- name: "Install Nginx"
22+
apt:
23+
name: nginx
24+
state: present
25+
update_cache: true
2626

27-
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/posix/synchronize_module.html
28-
- name: "Upload web directory"
29-
synchronize:
30-
src: files/html/
31-
dest: /var/www/html
32-
archive: true
33-
checksum: true
34-
recursive: true
35-
delete: true
27+
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/posix/synchronize_module.html
28+
- name: "Upload web directory"
29+
synchronize:
30+
src: files/html/
31+
dest: /var/www/html
32+
archive: true
33+
checksum: true
34+
recursive: true
35+
delete: true
3636

37-
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/copy_module.html
38-
- name: "Copy nginx configuration file"
39-
copy:
40-
src: files/default
41-
dest: /etc/nginx/sites-enabled/default
42-
owner: "{{ ansible_user }}"
43-
group: "{{ ansible_user }}"
44-
mode: '0644'
37+
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/copy_module.html
38+
- name: "Copy nginx configuration file"
39+
copy:
40+
src: files/default
41+
dest: /etc/nginx/sites-enabled/default
42+
owner: "{{ ansible_user }}"
43+
group: "{{ ansible_user }}"
44+
mode: '0644'
4545

46-
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/service_module.html
47-
- name: "Ensure nginx service started"
48-
service:
49-
name: nginx
50-
state: started
46+
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/service_module.html
47+
- name: "Ensure nginx service started"
48+
service:
49+
name: nginx
50+
state: started

2-ansible/05-handler/example.yaml

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4,55 +4,55 @@
44
hosts: ubuntu
55
become: true
66
tasks:
7-
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/user_module.html
8-
- name: "Create a user"
9-
user: "name=fastcampus shell=/bin/bash"
10-
11-
- name: "Hello World"
12-
command: "echo 'Hello World!'"
13-
14-
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html
15-
- name: "Add DNS server to resolv.conf"
16-
lineinfile:
17-
path: /etc/resolv.conf
18-
line: 'nameserver 8.8.8.8'
19-
20-
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/apt_module.html
21-
- name: "Install Nginx"
22-
apt:
23-
name: nginx
24-
state: present
25-
update_cache: true
26-
27-
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/posix/synchronize_module.html
28-
- name: "Upload web directory"
29-
synchronize:
30-
src: files/html/
31-
dest: /var/www/html
32-
archive: true
33-
checksum: true
34-
recursive: true
35-
delete: true
36-
37-
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/copy_module.html
38-
- name: "Copy nginx configuration file"
39-
copy:
40-
src: files/default
41-
dest: /etc/nginx/sites-enabled/default
42-
owner: "{{ ansible_user }}"
43-
group: "{{ ansible_user }}"
44-
mode: '0644'
45-
notify:
46-
- Restart Nginx
47-
48-
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/service_module.html
49-
- name: "Ensure nginx service started"
50-
service:
51-
name: nginx
52-
state: started
7+
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/user_module.html
8+
- name: "Create a user"
9+
user: "name=fastcampus shell=/bin/bash"
10+
11+
- name: "Hello World"
12+
command: "echo 'Hello World!'"
13+
14+
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html
15+
- name: "Add DNS server to resolv.conf"
16+
lineinfile:
17+
path: /etc/resolv.conf
18+
line: 'nameserver 8.8.8.8'
19+
20+
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/apt_module.html
21+
- name: "Install Nginx"
22+
apt:
23+
name: nginx
24+
state: present
25+
update_cache: true
26+
27+
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/posix/synchronize_module.html
28+
- name: "Upload web directory"
29+
synchronize:
30+
src: files/html/
31+
dest: /var/www/html
32+
archive: true
33+
checksum: true
34+
recursive: true
35+
delete: true
36+
37+
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/copy_module.html
38+
- name: "Copy nginx configuration file"
39+
copy:
40+
src: files/default
41+
dest: /etc/nginx/sites-enabled/default
42+
owner: "{{ ansible_user }}"
43+
group: "{{ ansible_user }}"
44+
mode: '0644'
45+
notify:
46+
- Restart Nginx
47+
48+
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/service_module.html
49+
- name: "Ensure nginx service started"
50+
service:
51+
name: nginx
52+
state: started
5353

5454
handlers:
55-
- name: Restart Nginx
56-
service:
57-
name: nginx
58-
state: restarted
55+
- name: Restart Nginx
56+
service:
57+
name: nginx
58+
state: restarted

2-ansible/06-vars/playbook.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
# vars_files:
1212
# - vars.yaml
1313
tasks:
14-
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/user_module.html
15-
# - name: "Create a user"
16-
# user:
17-
# name: "posquit0"
18-
# comment: "hard coding"
19-
# shell: "/bin/bash"
20-
# uid: "7777"
21-
- name: "Create a user"
22-
user:
23-
name: "{{ user_name }}"
24-
comment: "{{ user_comment }}"
25-
shell: "{{ user_shell }}"
26-
uid: "{{ user_uid }}"
14+
# Docs: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/user_module.html
15+
# - name: "Create a user"
16+
# user:
17+
# name: "posquit0"
18+
# comment: "hard coding"
19+
# shell: "/bin/bash"
20+
# uid: "7777"
21+
- name: "Create a user"
22+
user:
23+
name: "{{ user_name }}"
24+
comment: "{{ user_comment }}"
25+
shell: "{{ user_shell }}"
26+
uid: "{{ user_uid }}"

0 commit comments

Comments
 (0)