-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathansible.yaml
More file actions
56 lines (47 loc) · 1.27 KB
/
ansible.yaml
File metadata and controls
56 lines (47 loc) · 1.27 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
---
- name: Ansible
hosts: localhost
become: yes
become_user: root
tasks:
- name: apache setup
apt:
name: apache2
state: latest
- name: apache running
service:
name: apache2
state: started
- name: Run Uname
shell:
"uname -a"
register: unamea
tags: unamea
- debug: msg="{{unamea.stdout}}"
- name: Updating System
shell:
"apt update; apt upgrade;"
register: updates
tags: updates
- debug: msg="{{updates.stdout}}"
- name: Networking
shell:
"ip a show; ip r show;"
register: nets
tags: nets
- debug: msg="{{nets.stdout}}"
- name: Copy File
copy:
src: index.html
dest: /var/www/html/index.html
owner: root
group: root
mode: '0644'
- name: Create File
copy:
content: It is working
dest: /var/www/html/index.htm
### ansible-playbook --syntax-check ansible.yaml
### ansible localhost -m ansible.builtin.setup
### ansible localhost -m ansible.builtin.copy -a "src=index.html dest=/var/www/html/index.html mode=644 owner=root group=root"
### ansible localhost -a "ip a show"