Hi,

I am a n00b and I am trying to create a CA playbook that first locally 
creates certs, keys etc (using easy-rsa's pkitool) and then deploys these 
to the different play_hosts. -I might be going about this the wrong way, 
but is there a way to register the play_hosts in a list that can then be 
used when I change play_hosts to be just localhost, and then when I do the 
deploy go back to the original play_hosts?  


---
- hosts: all 
  sudo: yes 
  tasks: 
  - name: register current play_hosts for later 
    ping: 
    register: play_hosts_all    # this doesn't work obviously
  
- hosts: localhost 
  connection: local 
  sudo: yes 
  tasks: 
  - name: create keys/certs 
    command : pkitool {{ item }} 
    with_items: {{ play_hosts_all }}

- hosts: {{ play_hosts_all }}
  sudo: yes
  tasks:
  - name: deploy key/cert/...
    copy: src= ...  dest= ...




-- 
Xtratherm Limited is a limited company registered in Ireland. Registered 
number: 331130. Registered office: Kells Road, Navan, Co. Meath. Directors: 
D.E. Hynes, E.J. Hynes, S.K. Steenson, J. Keegan, B. Rafferty, T. Hynes. 
VAT Registration: IE6351130B
Xtratherm UK Limited is a limited company registered in England and Wales. 
Registered number: 4404208. Registered office: Holmewood Industrial Park, 
Park Road, Chesterfield, Derbyshire S42 5UY. VAT Registration: GB787574856
Please note that [Xtratherm Limited/Xtratherm UK Limited] may monitor 
e-mail traffic data and content of e-mail for the purpose of security and 
training.

-- 
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/3fa52e35-1104-4bfd-aea4-be39d0d2dfd0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to