Browse Source

ssh-agent

master
parent
commit
3f60000d4b
4 changed files with 33 additions and 1 deletions
  1. +1
    -0
      files/pam_env.conf
  2. +2
    -0
      files/ssh-agent.service.d.install
  3. +2
    -1
      tasks/main.yaml
  4. +28
    -0
      tasks/ssh-agent.yaml

+ 1
- 0
files/pam_env.conf View File

@@ -0,0 +1 @@
SSH_AUTH_SOCK DEFAULT="${XDG_RUNTIME_DIR}/openssh_agent"

+ 2
- 0
files/ssh-agent.service.d.install View File

@@ -0,0 +1,2 @@
[Install]
WantedBy=default.target

+ 2
- 1
tasks/main.yaml View File

@@ -3,13 +3,14 @@
# user setup
- import_tasks: root_user
- import_tasks: fish
- import_tasks: ssh-agent

# system setup
- import_tasks: hostname
when:
- not ansible_bender is defined
- not container_type | default('') == 'podman'
- import_tasks: locales

- import_tasks: timezone.yaml


+ 28
- 0
tasks/ssh-agent.yaml View File

@@ -0,0 +1,28 @@
---

- name: make ssh-agent user service override directory
file:
path: /etc/systemd/user/ssh-agent.service.d
state: directory

- name: make ssh-agent user service enableable
copy:
src: ssh-agent.service.d.install
dest: /etc/systemd/user/ssh-agent.service.d/install.conf

- name: ensure ssh-agent user service is enabled for all users
systemd:
enabled: yes
scope: global
name: ssh-agent.service

- name: ensure gpg-agent user socket is enabled for all users
systemd:
enabled: yes
scope: global
name: gpg-agent.socket

- name: pam_env.conf
copy:
src: pam_env.conf
dest: /etc/security/pam_env.conf