Hi All 

Doing something Im sure seems odd but building a production deployment 
script based on some very manual steps. The dev team list out all the 
services that need to be upgraded. I made a var called deploy to do two 
things.
1. Write out to a build file what needs to be build for prod. Its a flat 
file 
2. Be able to include upgrade tasks based on if api or data appears in the 
deployment list 

Example of my variable 

var:
  deploy:
      - api-app                     v2.41.0
      - api-develop              v0.23.2
      - api-tool                     v0.24.0
      - api-consumers         v0.16.0
      - api-data                    v0.57.2
      - api-bus                     eventbus-v1.1.2


Im trying to do the following. 

- include task/upgrade-api.yml
  when: "'api' in deploy"

This does not work as for some reason as Ive put spaces between it im 
thinking it cant seem to find 'api' at all. If I change the deploy var and 
remove the versions and have it as one liners like below, it will find a 
match if I was to have  when: "' api-too' in deploy. It seems to want to 
match a whole line and not part of it. I tried doing when: deploy 
|search("api'") but it failed because I think its a list. Im sure there is 
a better way to do this but wondering why my 'api in deploy" is not finding 
a match. 

var:
  deploy:
      - api-app
      - api-develop           
      - api-tool        
      - api-consumers      
      - api-data               
      - api-bus

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7a14fce9-c8ab-448d-9b81-7e0b5aa640e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to