浏览代码

ssh-agent

master
父节点
当前提交
3f60000d4b
共有 4 个文件被更改,包括 33 次插入1 次删除
  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 查看文件

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

+ 2
- 0
files/ssh-agent.service.d.install 查看文件

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

+ 2
- 1
tasks/main.yaml 查看文件

@@ -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 查看文件

@@ -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