summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2022-03-26 15:33:25 +0300
committereug-vs <eugene@eug-vs.xyz>2022-03-26 15:33:25 +0300
commit61d7461304682b1472ef569a842ca770e838c000 (patch)
tree374ed383805d0bd8ff630a94e609e0fc748e2b62
parentd0d1a95ca8f62edaae82f643b33d0fcf517eaf90 (diff)
downloadinfrastructure-61d7461304682b1472ef569a842ca770e838c000.tar.gz
refactor: polish playbooks
-rw-r--r--git-server.yaml16
-rw-r--r--setup.yaml2
-rw-r--r--syncthing.yaml1
-rw-r--r--taskd.yaml2
-rw-r--r--website.yaml1
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