ansible tag test

Pocket

どんな動きになるかのテストメモです

astelnoMacBook-Pro% cat roles/test/tasks/main.yml
---

- name: test no tag
  shell: echo ok

- name: test logback
  shell: echo ok
  tags: logback

- name: test deploy
  shell: echo ok
  tags: deploy

- name: test deploy logback
  shell: echo ok
  tags:
    - deploy
    - logback
astelnoMacBook-Pro%
astelnoMacBook-Pro% ansible-playbook -i inventory/vagrant astel.yml -ltest_server


PLAY [all] *********************************************************************

TASK [setup] *******************************************************************
ok: [192.168.122.11]

TASK [test : test no tag] ******************************************************
changed: [192.168.122.11]

TASK [test : test logback] *****************************************************
changed: [192.168.122.11]

TASK [test : test deploy] ******************************************************
changed: [192.168.122.11]

TASK [test : test deploy logback] **********************************************
changed: [192.168.122.11]

PLAY RECAP *********************************************************************
192.168.122.11             : ok=5    changed=4    unreachable=0    failed=0

astelnoMacBook-Pro%
astelnoMacBook-Pro%
astelnoMacBook-Pro%
astelnoMacBook-Pro%
astelnoMacBook-Pro% ansible-playbook -i inventory/vagrant astel.yml -ltest_server -t deploy

PLAY [all] *********************************************************************

TASK [setup] *******************************************************************
ok: [192.168.122.11]

TASK [test : test deploy] ******************************************************
changed: [192.168.122.11]

TASK [test : test deploy logback] **********************************************
changed: [192.168.122.11]

PLAY RECAP *********************************************************************
192.168.122.11             : ok=3    changed=2    unreachable=0    failed=0

astelnoMacBook-Pro%
astelnoMacBook-Pro%
astelnoMacBook-Pro% ansible-playbook -i inventory/vagrant astel.yml -ltest_server -t logback

PLAY [all] *********************************************************************

TASK [setup] *******************************************************************
ok: [192.168.122.11]

TASK [test : test logback] *****************************************************
changed: [192.168.122.11]

TASK [test : test deploy logback] **********************************************
changed: [192.168.122.11]

PLAY RECAP *********************************************************************
192.168.122.11             : ok=3    changed=2    unreachable=0    failed=0

astelnoMacBook-Pro%
astelnoMacBook-Pro%
astelnoMacBook-Pro%
astelnoMacBook-Pro% ansible-playbook -i inventory/vagrant astel.yml -ltest_server -t deploy,logback

PLAY [all] *********************************************************************

TASK [setup] *******************************************************************
ok: [192.168.122.11]

TASK [test : test logback] *****************************************************
changed: [192.168.122.11]

TASK [test : test deploy] ******************************************************
changed: [192.168.122.11]

TASK [test : test deploy logback] **********************************************
changed: [192.168.122.11]

PLAY RECAP *********************************************************************
192.168.122.11             : ok=4    changed=3    unreachable=0    failed=0

astelnoMacBook-Pro% 
astelnoMacBook-Pro% 

コメントを残す

メールアドレスが公開されることはありません。