[Q&A] Playbook mutiple hosts from aws TAGS

10 views
Skip to first unread message

Wojciech Gintowt

unread,
Oct 1, 2015, 9:29:24 AM10/1/15
to Ansible Project
Hi,
I'm doing a provisioning on AWS EC using tags variables. I'd like to make smt like

hosts:
  - host1
  - host2
task:
  -

But it's totally not working.

I'm including my playbook
---
- hosts: tag_deployment_tesing  <-   Can i SET this as variable EX tag_deployment_{{deployment}} ? i've tried don't wokr
  user: ubuntu
  sudo: yes
  tasks:
     - name: Gather facts
       action: ec2_facts
     - hostname: name={{ ec2_tag_Name }}
     - debug: var={{ ec2_tag_Name }}
  roles:
     - ntp
     - history
     - logwatch
     - snmpd


 
- name: Install Specifig apps - apache
  user: ubuntu
  hosts:
    - tag_client_test:&tag_deployment_tesing:&tag_role_app1          In this configuration do not working - if split hosts it's ok
    - tag_client_test:&tag_deployment_tesing:&tag_role_app1
  sudo: True
  gather_facts: True
  roles:
    - apache2
      
#- name: Install Specifig apps - apache
#  user: ubuntu
#  hosts:
#    - tag_client_test:&tag_deployment_tesing:&tag_role_app1
#  sudo: True
#  gather_facts: True
#  roles:
#    - apache2
#   
    
Reply all
Reply to author
Forward
0 new messages