Split codesearch into its own playbook

Make a service playbook, manifest and jobs for codesearch.

Remove openstack_project::server - it doesn't do anything.

Change-Id: I44c140de4ae0b283940f8e23e8c47af983934471
This commit is contained in:
Monty Taylor 2020-04-19 13:55:13 -05:00
parent 2f6483a236
commit d5c68c5131
7 changed files with 70 additions and 19 deletions

View File

@ -997,6 +997,33 @@
run_playbooks: run_playbooks:
- playbooks/remote_puppet_else.yaml - playbooks/remote_puppet_else.yaml
- job:
name: system-config-run-codesearch
parent: system-config-run
description: |
Run the playbook for an codesearch server.
nodeset:
nodes:
- name: bridge.openstack.org
label: ubuntu-bionic
- name: codesearch01.openstack.org
label: ubuntu-xenial
required-projects:
- opendev/system-config
- openstack/project-config
files:
- playbooks/install-ansible.yaml
- playbooks/service-codesearch.yaml
- playbooks/roles/sync-project-config
- playbooks/roles/puppet-install/
- playbooks/roles/disable-puppet-agent/
- modules/openstack_project/manifests/codesearch.pp
- modules/openstack_project/files/resync-hound-config.sh
- manifests/codesearch.pp
vars:
run_playbooks:
- playbooks/service-codesearch.yaml
- job: - job:
name: system-config-run-letsencrypt name: system-config-run-letsencrypt
parent: system-config-run parent: system-config-run
@ -2240,6 +2267,26 @@
- docker/jinja-init/ - docker/jinja-init/
- docker/python-base/ - docker/python-base/
- job:
name: infra-prod-service-codesearch
parent: infra-prod-service-base
description: Run service-codesearch.yaml playbook
required-projects:
- opendev/system-config
- openstack/project-config
vars:
playbook_name: service-codesearch.yaml
files:
- inventory/
- playbooks/install-ansible.yaml
- playbooks/service-codesearch.yaml
- playbooks/roles/sync-project-config
- playbooks/roles/puppet-install/
- playbooks/roles/disable-puppet-agent/
- modules/openstack_project/manifests/codesearch.pp
- modules/openstack_project/files/resync-hound-config.sh
- manifests/codesearch.pp
# Run AFS changes separately so we can make sure to only do one at a time # Run AFS changes separately so we can make sure to only do one at a time
# (turns out quorum is nice to have) # (turns out quorum is nice to have)
- job: - job:
@ -2491,6 +2538,7 @@
- system-config-run-backup - system-config-run-backup
- system-config-run-dns - system-config-run-dns
- system-config-run-eavesdrop - system-config-run-eavesdrop
- system-config-run-codesearch
- system-config-run-lists - system-config-run-lists
- system-config-run-nodepool - system-config-run-nodepool
- system-config-run-meetpad: - system-config-run-meetpad:
@ -2555,6 +2603,7 @@
- system-config-run-base - system-config-run-base
- system-config-run-dns - system-config-run-dns
- system-config-run-eavesdrop - system-config-run-eavesdrop
- system-config-run-codesearch
- system-config-run-lists - system-config-run-lists
- system-config-run-nodepool - system-config-run-nodepool
- system-config-run-meetpad: - system-config-run-meetpad:
@ -2667,6 +2716,7 @@
- infra-prod-service-review - infra-prod-service-review
- infra-prod-service-review-dev - infra-prod-service-review-dev
- infra-prod-service-gitea - infra-prod-service-gitea
- infra-prod-service-codesearch
- infra-prod-remote-puppet-afs - infra-prod-remote-puppet-afs
- infra-prod-remote-puppet-else - infra-prod-remote-puppet-else
periodic: periodic:
@ -2697,6 +2747,7 @@
- infra-prod-service-review - infra-prod-service-review
- infra-prod-service-review-dev - infra-prod-service-review-dev
- infra-prod-service-gitea - infra-prod-service-gitea
- infra-prod-service-codesearch
- infra-prod-remote-puppet-afs - infra-prod-remote-puppet-afs
opendev-prod-hourly: opendev-prod-hourly:
jobs: jobs:

View File

@ -28,6 +28,8 @@ groups:
# backup-server: # backup-server:
# - backup[0-9]*.opendev.org # - backup[0-9]*.opendev.org
cacti: cacti[0-9]*.open*.org cacti: cacti[0-9]*.open*.org
codesearch:
- codesearch[0-9]*.open*.org
control-plane-clouds: control-plane-clouds:
- bridge.openstack.org - bridge.openstack.org
disabled: disabled:

5
manifests/codesearch.pp Normal file
View File

@ -0,0 +1,5 @@
# Node-OS: xenial
node /^codesearch\d*\.open.*\.org$/ {
$group = "codesearch"
class { 'openstack_project::codesearch': }
}

View File

@ -990,14 +990,4 @@ node /^translate-dev\d*\.open.*\.org$/ {
} }
} }
# Node-OS: xenial
node /^codesearch\d*\.open.*\.org$/ {
$group = "codesearch"
class { 'openstack_project::server': }
class { 'openstack_project::codesearch':
project_config_repo => 'https://opendev.org/openstack/project-config',
}
}
# vim:sw=2:ts=2:expandtab:textwidth=79 # vim:sw=2:ts=2:expandtab:textwidth=79

View File

@ -1,11 +1,5 @@
# Class to configure hound on a node. # Class to configure hound on a node.
class openstack_project::codesearch ( class openstack_project::codesearch {
$project_config_repo,
) {
class { 'project_config':
url => $project_config_repo,
}
class { 'hound': class { 'hound':
manage_config => false, manage_config => false,
@ -37,7 +31,7 @@ class openstack_project::codesearch (
command => 'flock -n /var/run/hound.sync.lock resync-hound-config >> /var/log/hound.sync.log 2>&1', command => 'flock -n /var/run/hound.sync.lock resync-hound-config >> /var/log/hound.sync.log 2>&1',
environment => [ environment => [
'PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin', 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin',
"PROJECTS_YAML=${::project_config::jeepyb_project_file}", "PROJECTS_YAML=/opt/project-config/projects.yaml",
], ],
require => [ require => [
File['/usr/local/bin/resync-hound-config'], File['/usr/local/bin/resync-hound-config'],

View File

@ -1,4 +1,4 @@
- hosts: 'puppet:!review:!afs:!afsdb:!puppetmaster*:!nb*:!disabled' - hosts: 'puppet:!review:!afs:!afsdb:!puppetmaster*:!nb*:!codesearch:!disabled'
name: "Puppet-else: run puppet on all other servers" name: "Puppet-else: run puppet on all other servers"
strategy: free strategy: free
roles: roles:

View File

@ -0,0 +1,9 @@
- hosts: 'codesearch:!disabled'
name: "codesearch: run puppet on codesearch"
strategy: free
roles:
- sync-project-config
- puppet-install
- disable-puppet-agent
- name: puppet
manifest: /opt/system-config/production/manifests/codesearch.pp