-
Notifications
You must be signed in to change notification settings - Fork 19
/
lab2-7-grade.yml
43 lines (43 loc) · 1.39 KB
/
lab2-7-grade.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
- hosts: localhost
connection: local
tasks:
- name: hello world module
stat:
path: /home/devops/ansible_implementation/library/hello_world.py
register: mod1_facts
- fail:
msg: "FAILED: hello_world module is not present"
when: mod1_facts.stat.exists != true
- debug:
msg: "Success: hello_world module pressent"
when: mod1_facts.stat.exists == true
- name: version change module
stat:
path: /home/devops/ansible_implementation/library/version_change.py
register: mod2_facts
- fail:
msg: "FAILED: version_change module is not present"
when: mod2_facts.stat.exists != true
- debug:
msg: "Success: version_change module pressent"
when: mod2_facts.stat.exists == true
- name: first-module playbook
stat:
path: /home/devops/ansible_implementation/first-module.yml
register: first
- fail:
msg: "FAILED: first-module playbook is not present"
when: first.stat.exists != true
- debug:
msg: "Success: first-module playbook pressent"
when: first.stat.exists == true
- name: second-module playbook
stat:
path: /home/devops/ansible_implementation/second-module.yml
register: second
- fail:
msg: "FAILED: second-module playbook is not present"
when: second.stat.exists != true
- debug:
msg: "Success: second-module playbook pressent"
when: second.stat.exists == true