Attempt to run ansible pre-deploy steps
This commit is contained in:
parent
b626f5eb97
commit
ea38d38d06
@ -1,5 +1,42 @@
|
||||
---
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Echo test
|
||||
shell: echo 'pre-deploy!'
|
||||
- name: Setup host Gitea group
|
||||
group:
|
||||
name: gitea
|
||||
system: true
|
||||
state: present
|
||||
|
||||
- name: Setup host Gitea user
|
||||
user:
|
||||
name: gitea
|
||||
comment: gitea user
|
||||
create_home: true
|
||||
home: /var/lib/gitea
|
||||
group: gitea
|
||||
system: true
|
||||
state: present
|
||||
generate_ssh_key: true
|
||||
ssh_key_bits: 2048
|
||||
ssh_key_file: .ssh/id_rsa
|
||||
|
||||
- name: Get uid/guid of the gitea user
|
||||
getent:
|
||||
database: passwd
|
||||
key: gitea
|
||||
split: ":"
|
||||
|
||||
- name: Store gitea git user uid/guid
|
||||
set_fact:
|
||||
gitea_user_uid: "{{ getent_passwd['gitea'][1] }}"
|
||||
gitea_user_guid: "{{ getent_passwd['gitea'][2] }}"
|
||||
|
||||
- name: Configure the dokku app environment
|
||||
dokku_config:
|
||||
app: gitea
|
||||
restart: false
|
||||
config:
|
||||
USER_GID: "{{ gitea_user_guid }}"
|
||||
USER_UID: "{{ gitea_user_uid }}"
|
||||
become: true
|
||||
become_user: dokku
|
||||
|
Reference in New Issue
Block a user