D
D
Dmitry Erokhin2016-07-04 18:25:38
Ansible
Dmitry Erokhin, 2016-07-04 18:25:38

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

1 answer(s)
D
Dmitry Erokhin, 2017-03-09
@erohin_d

Not provided.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question