Skip to content

Commit

Permalink
freebsd fix
Browse files Browse the repository at this point in the history
  • Loading branch information
reelsense committed Oct 21, 2018
1 parent b4cd66f commit 8701575
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,27 @@
- skip_missing: true
when: item.ssh_config is defined and item.state == "present" and item.name != 'ec2-user' and ansible_os_family == 'Debian'


- name: Configure ~/.ssh/config FreeBSD
blockinfile:
#path: "/home/{{ item.0.name }}/.ssh/config"
path: "/home/{{ item.name }}/.ssh/config"
#owner: "{{ item.0.name }}"
owner: "{{ item.name }}"
#group: "{{ item.0.name }}"
group: "{{ item.name }}"
mode: 0600
marker: "# {mark} ANSIBLE MANAGED BLOCK"
content: |
{% for host in groups['all'] -%}
Host {{ hostvars[host]['ansible_hostname'] }}
Hostname {{ hostvars[host]['inventory_hostname'] }}
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
{% for item in item.ssh_config %}
{{ item.line }}
{% endfor %}
{% endfor %}
with_items:
- "{{ users }}"
- skip_missing: true
when: item.ssh_config is defined and item.state == "present" and item.name != 'ubuntu' and ansible_os_family == 'FreeBSD'

0 comments on commit 8701575

Please sign in to comment.