Update README.md

This commit is contained in:
qiaofeng1227 2021-12-20 12:07:14 +08:00 committed by GitHub
parent 815be856ac
commit e58b3907a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,4 +70,30 @@ docker run -d --name art -v /root/role_mysql:/ansible/role_mysql art:2.0
[root@VM-74-236-centos ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f8ec36905530 art:2.0 "/usr/sbin/init" 9 minutes ago Up 9 minutes art
[root@f8ec36905530 ansible]# vim role_template/tasks/main.yml
- name: Install this role on {{ansible_os_family}}
include: "{{ansible_os_family}}.yml"
- name: Test you add task
shell: echo "Your ansible runtime is OK"
[root@f8ec36905530 ansible]# ansible-playbook role_template/tests/test.yml
PLAY [localhost] *************************************************************************************************************************************************************************************************************************************************************
TASK [Gathering Facts] *******************************************************************************************************************************************************************************************************************************************************
ok: [localhost]
TASK [role_template : Install this role on RedHat] ***************************************************************************************************************************************************************************************************************************
TASK [role_template : Test you add task] *************************************************************************************************************************************************************************************************************************************
changed: [localhost]
PLAY RECAP *******************************************************************************************************************************************************************************************************************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
[root@f8ec36905530 ansible]#
```