Last active
December 26, 2015 20:59
-
-
Save danrough/7212365 to your computer and use it in GitHub Desktop.
Getting a file based on a variable in Ansible
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
--- | |
############################################################ | |
# The lookup on line 9 is currenlty failing. | |
# Can anyone recommend how I can achieve the following? | |
# Is there a better way to go about doing what I've set out to do here? | |
############################################################ | |
- name: Add user {{ user }} | |
user: name={{user}} | |
- name: Add keys for user {{ user }} | |
authorized_key: user={{ user }} key="{{ lookup('file', user +'.txt') }}" | |
manage_dir=yes state=present unique=yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment