fix issue with .ssh directory not existing

This commit is contained in:
vincent 2021-07-10 14:40:17 +02:00
parent e424e084db
commit c10188eedf
2 changed files with 40 additions and 36 deletions

View File

@ -30,7 +30,7 @@
become: yes become: yes
when: ansible_facts['os_family'] == "Archlinux" when: ansible_facts['os_family'] == "Archlinux"
- name: install aur workstation soft - name: install aur workstation soft
aur: aur:
name: "{{ system_base_aur_soft }}" name: "{{ system_base_aur_soft }}"
state: present state: present
@ -46,7 +46,6 @@
become: yes become: yes
when: ansible_facts['os_family'] == "Debian" when: ansible_facts['os_family'] == "Debian"
- name: GITHUB | Get current version of bat - name: GITHUB | Get current version of bat
shell: > shell: >
warn=False warn=False
@ -59,7 +58,6 @@
not bat_version.stdout|regex_search('\w+\.\w+\.\w+') not bat_version.stdout|regex_search('\w+\.\w+\.\w+')
when: ansible_facts['os_family'] == "Debian" when: ansible_facts['os_family'] == "Debian"
- name: DEBIAN | Set URL to download bins - name: DEBIAN | Set URL to download bins
set_fact: set_fact:
debian_url: "https://github.com/sharkdp/bat/releases/download/v{{ bat_version.stdout }}/bat_{{ bat_version.stdout }}_amd64.deb" debian_url: "https://github.com/sharkdp/bat/releases/download/v{{ bat_version.stdout }}/bat_{{ bat_version.stdout }}_amd64.deb"

View File

@ -11,6 +11,14 @@
with_items: with_items:
- "{{user.name}}" - "{{user.name}}"
- root - root
- name: ensure key directory exist
become: true
file:
state: directory
path: "{{ item.keyfile | dirname }}"
owner: "{{item.user}}"
mode: 0600
with_items: "{{privatekeytodeploy}}"
- name: Install ssh private key - name: Install ssh private key
become: yes become: yes
@ -29,11 +37,9 @@
with_items: "{{keystodeploy}}" with_items: "{{keystodeploy}}"
become: yes become: yes
- name: les connexions par mot de passe sont désactivées
- name : les connexions par mot de passe sont désactivées
become: yes become: yes
lineinfile : lineinfile:
dest: /etc/ssh/sshd_config dest: /etc/ssh/sshd_config
regexp: "^#?PasswordAuthentication" regexp: "^#?PasswordAuthentication"
line: "PasswordAuthentication no" line: "PasswordAuthentication no"