Created
October 11, 2018 00:29
-
-
Save nshenry03/dd05ff99cfd33af22c7f94b70901dbd0 to your computer and use it in GitHub Desktop.
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 | |
gather_facts: no | |
vars: | |
user_list: | |
- name: john.doe | |
git_config: | |
- user.name: John Doe | |
- user.email: john.doe@example.com | |
- user.signingkey: 0A46826A | |
- name: jane.doe | |
git_config: | |
- user.name: Jane Doe | |
- diff.tool: meld | |
tasks: | |
- debug: | |
msg: "User: {{ item.0.name }}, Key: {{ item.1 }}" | |
loop: "{{ user_list | subelements('git_config') }}" | |
# Eventually, I would like to be able to do something like this using Ansible's git_config module: https://docs.ansible.com/ansible/2.4/git_config_module.html | |
# - git_config: | |
# name: "{{ item.1.key }}" | |
# value: "{{ item.1.value }}" | |
# scope: global | |
# loop: "{{ user_list | <<Some Ansible Magic>> }}" | |
# become: yes | |
# become_user: "{{ item.0.name }}" |
Author
nshenry03
commented
Oct 11, 2018
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment