-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.yaml
57 lines (53 loc) · 1.43 KB
/
main.yaml
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
---
- hosts: drone
connection: local
gather_facts: false
tasks:
- name: |
Check if system is read write
description: Checks to see if the system is read only. If so, the system is given read/write (rw)
ansible.netcommon.telnet:
host: 192.168.42.1
password: ""
login_prompt: ""
prompts:
- "[#$]"
command:
- touch /etc/test
register: result
ignore_errors: yes
- name: Print the result
debug:
var: result
- name: Clean up /etc/test
ansible.netcommon.telnet:
host: 192.168.42.1
password: ""
login_prompt: ""
prompts:
- "[#$]"
command:
- rm /etc/test
when: result.changed == true
- name: |
Check if system is read write
description: If system is read only, then make it read write
ansible.netcommon.telnet:
host: 192.168.42.1
password: ""
login_prompt: ""
prompts:
- "[#$]"
command: mount -o remount,rw /
when: result.failed == true
- name: |
Update /etc/inetd.conf with FTP port 71
description: Add port 71 to inetd.conf
ansible.netcommon.telnet:
host: 192.168.42.1
password: ""
login_prompt: ""
prompts:
- "[#$]"
command:
- "echo '71 stream tcp nowait root ftpd ftpd -SS /' >> /etc/inetd.conf"