Feature users config ssh #9 #10
5
hosts
5
hosts
|
@ -1,2 +1,3 @@
|
||||||
10.106.116.157 ssh_short_name=host1
|
10.106.116.157 ssh_short_name=host1 ansible_user=root
|
||||||
10.106.116.139 ssh_short_name=host2
|
10.106.116.139 ssh_short_name=host2 ansible_user=root
|
||||||
|
34.242.108.38 ssh_short_name=freebsd1 ansible_user=ec2-user ansible_python_interpreter=/usr/local/bin/python2.7
|
||||||
|
|
|
@ -18,40 +18,3 @@
|
||||||
- "{{ users }}"
|
- "{{ users }}"
|
||||||
- keys
|
- keys
|
||||||
|
|
||||||
|
|
||||||
#- name: Check if user has ~/.ssh/config
|
|
||||||
# stat:
|
|
||||||
# path: "/home/{{ item.name }}/.ssh/config"
|
|
||||||
# with_items: "{{ users }}"
|
|
||||||
# register: sshconfig
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#- name: Create ~/.ssh/config when absent
|
|
||||||
# file:
|
|
||||||
# path: "/home/{{ item.item.name }}/.ssh/config"
|
|
||||||
# owner: "{{ item.item.name }}"
|
|
||||||
# group: "{{ item.item.name }}"
|
|
||||||
# mode: 0600
|
|
||||||
# state: touch
|
|
||||||
# when: item.stat.exists == False
|
|
||||||
# with_items:
|
|
||||||
# - "{{ sshconfig.results }}"
|
|
||||||
# no_log: True
|
|
||||||
#
|
|
||||||
#- name: Configure ~/.ssh/config
|
|
||||||
# blockinfile:
|
|
||||||
# path: "/home/{{ item.name }}/.ssh/config"
|
|
||||||
# owner: "{{ item.name }}"
|
|
||||||
# group: "{{ item.name }}"
|
|
||||||
# mode: 0600
|
|
||||||
# marker: "# {mark} ANSIBLE MANAGED BLOCK"
|
|
||||||
# content: |
|
|
||||||
# host {{ ansible_hostname }}
|
|
||||||
# hostname {{ ansible_hostname }}
|
|
||||||
# User {{ item.name }}
|
|
||||||
# RemoteForward /home/{{ item.name }}/.gnupg/S.gpg-agent $HOME/.gnupg/S.gpg-agent
|
|
||||||
# RemoteForward /home/{{ item.name }}/.gnupg/S.gpg-agent.ssh $HOME/.gnupg/S.gpg-agent.ssh
|
|
||||||
# ServerAliveInterval 10
|
|
||||||
# with_items:
|
|
||||||
# - "{{ users }}"
|
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
uid: "{{ item.uid | default(omit) }}"
|
uid: "{{ item.uid | default(omit) }}"
|
||||||
shell: "{{ item.shell | default(default_shell) }}"
|
shell: "{{ item.shell | default(default_shell) }}"
|
||||||
append: yes
|
append: yes
|
||||||
no_log: True
|
no_log: True
|
||||||
with_items: "{{ users }}"
|
with_items: "{{ users }}"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue