Executando múltiplos comandos no Ansible

From Basef
Revision as of 19:15, 25 April 2015 by Admin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Para executar múltiplos comandos no Ansible, basta usar o trecho de código a seguir no playbook:

- name: "Executando múltiplos comandos com Ansible"
  sudo: yes
  command: "{{ item }}"
  with_items:
  - gpg --keyserver keys.gnupg.net --recv-keys 5C927F7C
  - gpg -a --export 5C927F7C | apt-key add -

O código acima está executando dois comandos do shell:

gpg --keyserver keys.gnupg.net --recv-keys 5C927F7C
gpg -a --export 5C927F7C | apt-key add -