Remember that lookups are local

Go ahead and actually clone project-config on bridge, because
we're going to read the projects.yaml file with a lookup. Because
it's a local action, not a remote action.

Change-Id: I77454bcb10b797ce5b48018caef7fecb31947b97
This commit is contained in:
Monty Taylor 2019-03-01 21:38:51 +00:00
parent 43a7014c88
commit e836fb7af6
3 changed files with 3 additions and 11 deletions

View File

@ -3,12 +3,11 @@
strategy: free
connection: local
tasks:
# Note that git module does ls-remote if clone is set to no and places
# the remote_head value in returndict.after
- name: Grab project-config repo info
git:
repo: https://git.openstack.org/openstack-infra/project-config
clone: no
dest: /opt/project-config
force: yes
register: gitinfo
- hosts: "git-server:!disabled"

View File

@ -1,3 +1 @@
gitea_url: https://localhost:3000
project_config_ref: master
project_config_dest: /opt/project_config

View File

@ -1,11 +1,6 @@
- name: Clone project-config
git:
repo: https://git.openstack.org/openstack-infra/project-config
dest: "{{ project_config_dest }}"
version: "{{ project_config_ref }}"
- name: Get Gerrit project list
set_fact:
gerrit_projects: "{{ lookup('file', project_config_dest + '/gerrit/projects.yaml') | from_yaml }}"
gerrit_projects: "{{ lookup('file', '/opt/project-config/gerrit/projects.yaml') | from_yaml }}"
- name: Parse Gerrit org list
set_fact:
gerrit_orgs: "{{ gerrit_projects | map(attribute='project') | map('regex_search', '^(.*?)/') | list | unique | select | map('regex_replace', '/', '') | list }}"