You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
1.5 KiB
76 lines
1.5 KiB
---
|
|
- hosts: service
|
|
remote_user: docker
|
|
sudo: yes
|
|
gather_facts: no
|
|
vars:
|
|
user: "docker"
|
|
|
|
tasks:
|
|
|
|
|
|
# ls -al test
|
|
|
|
# - name: ls -al
|
|
# become: yes
|
|
# become_user: "{{ user }}"
|
|
# command: ls -al
|
|
# ignore_errors: yes
|
|
# register: config
|
|
|
|
# - name: ls config
|
|
# debug: var=config.stdout_lines
|
|
|
|
|
|
# transfer script update
|
|
|
|
- name: Transfer script.
|
|
copy: src=script_update.sh dest=/home/docker mode=0777
|
|
|
|
# exec script
|
|
- name: Exec script_update.
|
|
command: sh /home/docker/script_update.sh
|
|
|
|
# transfer script iptables
|
|
|
|
# - name: Transfer script iprules.
|
|
# copy: src=iptables_rules.sh dest=/home/docker mode=0777
|
|
|
|
# transfer script imedusa
|
|
|
|
- name: Transfer script medusa.
|
|
copy: src=medusa_script.sh dest=/home/docker mode=0777
|
|
|
|
# transfer script fail2ban
|
|
|
|
# - name: Transfer script fail2ban.
|
|
# copy: src=fail2ban_script.sh dest=/home/docker mode=0777
|
|
|
|
# transfer script sshkey_script
|
|
|
|
# - name: Transfer script sshkey.
|
|
# copy: src=sshkey_script.sh dest=/home/docker mode=0777
|
|
|
|
|
|
# install hping3
|
|
- name: Ansible apt install hping3.
|
|
become: true
|
|
apt:
|
|
name: hping3
|
|
state: present
|
|
update_cache: true
|
|
|
|
# install sshpass
|
|
- name: Ansible apt install sshpass.
|
|
become: true
|
|
apt:
|
|
name: sshpass
|
|
state: present
|
|
update_cache: true
|
|
|
|
|
|
# refresh
|
|
- name: Refresh connection
|
|
meta: clear_host_errors
|
|
|
|
|
|
|