Answer the question
In order to leave comments, you need to log in
How to write ansible-playbook to execute only certain tags?
There is a playbook.yml:
---
- hosts: web-301-okt
roles:
- vektor
There is a role vektor in which /roles/vektor/tasks/main.yml:
---
- name: download_rvec
shell: wget -t 25 ftp ://{{ ftplogin1 }}:{{ ftppassword1 }}@{{ serverftp1 }}/{{ ftpdir1 }}/12.zip -O /opt/12.zip
tags: download
- name: stop
shell: /etc/ init.d/my-daemon.sh stop
tags:
- stop
- restart
- name: start
shell: /etc/init.d/my-daemon.sh start
tags:
- start
- restart
How can I run only tags - restart, not through the command line:
ansible-playbook -i /opt/ansible/hosts playbook.yml --tags "restart"
and write this in playbook.yml?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question