Add infra-prod-base job to set up git repos

Git repo setup for infra prod playbook jobs needs to happen in a trusted
playbook.  Create a base job to do that.

Change-Id: Ic0a1546141ccf3f030d3fbb073954792cea3cd55
This commit is contained in:
James E. Blair 2020-07-24 08:58:47 -07:00
parent 6e3f4db738
commit 6800004f69
3 changed files with 50 additions and 0 deletions

View File

@ -8,3 +8,10 @@ Miscellaneous Jobs
.. zuul:autojob:: opendev-promote-javascript-deployment-tarball
.. zuul:autojob:: opendev-release-python
.. zuul:autojob:: opendev-upload-git-mirror
Specialized Jobs
================
These jobs are not for general use.
.. zuul:autojob:: opendev-infra-prod-base

View File

@ -0,0 +1,34 @@
- hosts: localhost
tasks:
- name: Add bridge.o.o to inventory
add_host:
name: bridge.openstack.org
ansible_python_interpreter: python3
ansible_user: zuul
# Without setting ansible_host directly, mirror-workspace-git-repos
# gets sad because if delegate_to localhost and with add_host that
# ends up with ansible_host being localhost.
ansible_host: bridge.openstack.org
ansible_port: 22
- hosts: localhost
tasks:
- name: Add bridge.o.o hostkey to known hosts
known_hosts:
name: bridge.openstack.org
key: "bridge.openstack.org ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCxRzDkWvvVQtsLTAqAwedRWA84/42KKVdFS0QP8lZFsMpgTXUhjipJ7VcFun5gM87tnt0J71rlN+ospBh0/1wfp2jASEskUyGhXAa5xHjnJN7veUyW+AggEosK/OTunvZgf54p1sQg45Sq/uCjc0Ua0fRMOq2o5z/mgpl6rSjLOlWi9wKA/6axnUbs9w4iD5esyBQ+VcISSJOTqhAo/3UG0NwCU+6Ggwwhg0nl5iCMpQfq4A207IbJ72MkJzlQgW3edsRb5POzdZcGxkTYvVdP3kgHP4Bof3MFFZjBUMz6SuRQyNV5poysMtbtlO0SvgAJNhXr6Vn0GA9XhqFP6+HT"
- hosts: bridge.openstack.org
tasks:
- name: "Make sure a manaul maint isn't going on"
wait_for:
path: /home/zuul/DISABLE-ANSIBLE
state: absent
sleep: 10
timeout: 3600 # Wait for an hour before bailing
# This role executes code on the executor, so this needs to be in
# a trusted playbook.
- name: Synchronize src repos to workspace directory.
include_role:
name: prepare-workspace-git

View File

@ -576,3 +576,12 @@
run: playbooks/upload-git-mirror/run.yaml
nodeset:
nodes: []
- job:
name: opendev-infra-prod-base
description: |
A base job for running production playbooks on OpenDev's bridge.
This is not for general use.
abstract: true
pre-run: playbooks/infra-prod/pre.yaml