Created
January 29, 2014 23:05
-
-
Save halberom/8699152 to your computer and use it in GitHub Desktop.
passing items to lookup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
vars: | |
users: | |
- user1 | |
- user2 | |
tasks: | |
- name: create users | |
user: name={{item}} state=present | |
with_items: users | |
- name: copy key | |
authorized_key: user={{item}} | |
key="{{ lookup('file', '/etc/ansible/files/keys/' + item + '.pub') }}" manage_dir=yes | |
with_items: users | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment