Created
October 2, 2013 21:55
-
-
Save base10/6801059 to your computer and use it in GitHub Desktop.
Testing out users and user creation with ansible. Goal: Determine if running the user module regenerates ssh keys across multiple ansible runs. Context: Behavior seen by cheboygan in Ansible 1.2 series, reported in #ansible on October 2, 2013. Setup: - Ansible devel (as of bff47df)
- Python 2.7.5
- Three Amazon EC2 instances, same AMI (spun up o…
This file contains hidden or 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
- name: deploy test files | |
hosts: tag_Name_usertest | |
user: '{{ user }}' | |
sudo: true | |
gather_facts: True | |
vars: | |
new_user: nathan | |
tasks: | |
- name: generate ssh keys | |
user: > | |
name={{ new_user }} | |
generate_ssh_key=yes | |
ssh_key_type=rsa | |
ssh_key_bits=2048 | |
ssh_key_comment="{{ new_user }}@{{ ansible_hostname }}[ansible-generated]" | |
tags: [ cluster-ssh ] |
This file contains hidden or 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
[~/Desktop/ansible-bug] ansible-playbook -i $ANSIBLE_HOME/plugins/inventory/ec2.py add-users.yml | |
PLAY [deploy test files] ****************************************************** | |
GATHERING FACTS *************************************************************** | |
ok: [redacted1.example.com] | |
ok: [redacted2.example.com] | |
ok: [redacted3.example.com] | |
TASK: [generate ssh keys] ***************************************************** | |
ok: [redacted2.example.com] | |
ok: [redacted1.example.com] | |
ok: [redacted3.example.com] | |
PLAY RECAP ******************************************************************** | |
redacted3.example.com : ok=2 changed=0 unreachable=0 failed=0 | |
redacted1.example.com : ok=2 changed=0 unreachable=0 failed=0 | |
redacted2.example.com : ok=2 changed=0 unreachable=0 failed=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment