Add a simple playbook example
This commit is contained in:
parent
3c6bbce63c
commit
c160b86321
1 changed files with 31 additions and 0 deletions
31
playbook.yml
Normal file
31
playbook.yml
Normal file
|
@ -0,0 +1,31 @@
|
|||
- hosts: all
|
||||
gather_facts: False
|
||||
tasks:
|
||||
- name: Gathering facts
|
||||
ubus: cmd=facts
|
||||
|
||||
- name: Installing dependencies for file-related modules
|
||||
opkg: pkg=luaposix,coreutils-sha1sum state=present update_cache=yes
|
||||
|
||||
- name: Securing uhttpd - Disable listening on wan
|
||||
uci: name={{ item.key }} value={{ uci.state.network.lan.ipaddr }}:{{ item.port }} autocommit=false
|
||||
with_items:
|
||||
- { key: 'uhttpd.main.listen_http', port: '80' }
|
||||
- { key: 'uhttpd.main.listen_https', port: '443' }
|
||||
notify:
|
||||
- uci commit
|
||||
- uhttp reload
|
||||
- name: Securing dropbear - Disable login from wan
|
||||
uci: name=dropbear.@dropbear[0].Interface value=br-lan autocommit=false
|
||||
notify:
|
||||
- uci commit
|
||||
- dropbear reload
|
||||
|
||||
handlers:
|
||||
- name: uci commit
|
||||
raw: uci commit
|
||||
- name: uhttp reload
|
||||
raw: /etc/init.d/uhttpd reload
|
||||
- name: dropbear reload
|
||||
raw: /etc/init.d/dropbear reload
|
||||
|
Loading…
Add table
Reference in a new issue