Add simple ci deployment

This commit is contained in:
Marty Oehme 2021-12-20 11:47:11 +01:00
parent 3ee003f94c
commit 06bb34891e
Signed by: Marty
GPG key ID: B7538B8F50A1C800
6 changed files with 162 additions and 0 deletions

View file

@ -0,0 +1,12 @@
---
## install requisites
- name: Ensure openssl installed
ansible.builtin.package:
name: "openssl"
state: present
become: yes
tags:
- apt
- download
- packages

View file

@ -1,4 +1,26 @@
---
## Prepare woodpecker ci
- name: "Select tasks for {{ ansible_distribution }} {{ ansible_distribution_major_version }}"
include_tasks: "{{ distribution }}"
with_first_found:
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
loop_control:
loop_var: distribution
when: gitea_use_ci == True
- name: Generate agent key
ansible.builtin.shell: openssl rand -hex 32
register: gitea_woodpecker_agent_secret
when: gitea_use_ci == True
- name: Set agent key
ansible.builtin.set_fact:
gitea_woodpecker_agent_secret: "{{ gitea_woodpecker_agent_secret.stdout }}"
when: gitea_woodpecker_agent_secret.stdout is not undefined and not None
## Prepare gitea
- name: Ensure git user exists with ssh key
ansible.builtin.user:
name: "{{ gitea_git_username }}"