Add utility playbook for fixing gitea project settings

We normally only do project settings when we create the project.
Add a playbook we can use to do a manual sync from project-config.

Change-Id: I5260f2de697420a01d796acc3128be00705a53ee
This commit is contained in:
Monty Taylor 2019-03-04 16:06:49 +00:00
parent 1b7d793f7d
commit d3220a7ade
3 changed files with 22 additions and 1 deletions

View File

@ -1 +1,2 @@
gitea_url: https://localhost:3000 gitea_url: https://localhost:3000
gitea_always_update: false

View File

@ -23,7 +23,7 @@
private: false private: false
register: create_repo_result register: create_repo_result
- name: Adjust repo settings - name: Adjust repo settings
when: project.project not in gitea_repos when: gitea_always_update or project.project not in gitea_repos
uri: uri:
url: "{{ gitea_url }}/{{ org }}/{{ repo }}/settings" url: "{{ gitea_url }}/{{ org }}/{{ repo }}/settings"
validate_certs: false validate_certs: false

View File

@ -0,0 +1,20 @@
- hosts: "localhost:!disabled"
name: "sync-gitea-projects: Collect the project-config ref"
strategy: free
connection: local
tasks:
- name: Clone project-config repo
git:
repo: https://git.openstack.org/openstack-infra/project-config
dest: /opt/project-config
force: yes
register: gitinfo
- hosts: "gitea:!disabled"
name: "Create repos on gitea servers"
strategy: free
max_fail_percentage: 1
roles:
- role: gitea-git-repos
project_config_ref: "{{ hostvars.localhost.gitinfo.after }}"
gitea_always_update: true