This repository has been archived on 2020-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
git.autonomic.zone/ansible/pre-deploy.yml

51 lines
1.2 KiB
YAML
Raw Normal View History

2020-03-19 00:46:09 +00:00
---
- hosts: all
tasks:
2020-03-21 00:48:23 +00:00
- name: Load variables
include_vars:
file: "/var/lib/dokku/data/ansible/gitea/vars.yml"
name: app_vars
- name: Setup host Gitea group
group:
name: gitea
system: true
state: present
2020-03-19 23:48:11 +00:00
become: true
- 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
2020-03-19 23:48:11 +00:00
become: true
- name: Get uid/guid of the gitea user
getent:
database: passwd
key: gitea
split: ":"
2020-03-19 23:48:11 +00:00
become: true
- 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