From 61d7461304682b1472ef569a842ca770e838c000 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 26 Mar 2022 15:33:25 +0300 Subject: refactor: polish playbooks --- git-server.yaml | 16 +++++++++------- setup.yaml | 2 +- syncthing.yaml | 1 + taskd.yaml | 2 -- website.yaml | 1 + 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/git-server.yaml b/git-server.yaml index d94bd24..9d612a5 100644 --- a/git-server.yaml +++ b/git-server.yaml @@ -1,6 +1,7 @@ --- - name: Setup git server hosts: raspberry + gather_facts: false tasks: - name: Install packages become: true @@ -19,15 +20,16 @@ # user - name: Create git user become: true - shell: | - useradd git -m - mkdir /home/git/.ssh + user: + name: git - - name: Copy SSH keys + - name: Add public key to authorized_keys become: true - copy: - src: ~/.ssh/id_rsa.pub - dest: /home/git/.ssh/authorized_keys + authorized_key: + user: git + state: present + key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}" + # nginx - name: Copy nginx configuration diff --git a/setup.yaml b/setup.yaml index 8acd520..c3006f4 100644 --- a/setup.yaml +++ b/setup.yaml @@ -1,13 +1,13 @@ --- - name: First-boot setup hosts: raspberry + gather_facts: false tasks: - name: Install packages become: true tags: - slow apt: - upgrade: yes update_cache: yes pkg: - neovim diff --git a/syncthing.yaml b/syncthing.yaml index 3888495..1d82682 100644 --- a/syncthing.yaml +++ b/syncthing.yaml @@ -1,6 +1,7 @@ --- - name: Setup website hosts: raspberry + gather_facts: false tasks: - name: Install packages become: true diff --git a/taskd.yaml b/taskd.yaml index 7b635c5..a8ac42d 100644 --- a/taskd.yaml +++ b/taskd.yaml @@ -20,8 +20,6 @@ - name: Add public key to authorized_keys become: true - tags: - - test authorized_key: user: taskd state: present diff --git a/website.yaml b/website.yaml index 41e4281..60dda4e 100644 --- a/website.yaml +++ b/website.yaml @@ -1,6 +1,7 @@ --- - name: Setup website hosts: raspberry + gather_facts: false tasks: - name: Install packages become: true -- cgit v1.2.3