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.
48 lines
823 B
48 lines
823 B
---
|
|
- 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
|
|
|
|
- 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
|
|
|
|
|
|
# install hping3
|
|
- name: Ansible apt install hping3.
|
|
become: true
|
|
apt:
|
|
name: hping3
|
|
state: present
|
|
update_cache: true
|
|
|
|
|
|
# refresh
|
|
- name: Refresh connection
|
|
meta: clear_host_errors
|
|
|
|
|
|
|