From d5c68c51312fd6367b5e2901042281ecd69ec1b7 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sun, 19 Apr 2020 13:55:13 -0500 Subject: [PATCH] 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 --- .zuul.yaml | 51 +++++++++++++++++++ inventory/groups.yaml | 2 + manifests/codesearch.pp | 5 ++ manifests/site.pp | 10 ---- .../openstack_project/manifests/codesearch.pp | 10 +--- playbooks/remote_puppet_else.yaml | 2 +- playbooks/service-codesearch.yaml | 9 ++++ 7 files changed, 70 insertions(+), 19 deletions(-) create mode 100644 manifests/codesearch.pp create mode 100644 playbooks/service-codesearch.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 8725710a74..5c4b701483 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -997,6 +997,33 @@ run_playbooks: - 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: name: system-config-run-letsencrypt parent: system-config-run @@ -2240,6 +2267,26 @@ - docker/jinja-init/ - 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 # (turns out quorum is nice to have) - job: @@ -2491,6 +2538,7 @@ - system-config-run-backup - system-config-run-dns - system-config-run-eavesdrop + - system-config-run-codesearch - system-config-run-lists - system-config-run-nodepool - system-config-run-meetpad: @@ -2555,6 +2603,7 @@ - system-config-run-base - system-config-run-dns - system-config-run-eavesdrop + - system-config-run-codesearch - system-config-run-lists - system-config-run-nodepool - system-config-run-meetpad: @@ -2667,6 +2716,7 @@ - infra-prod-service-review - infra-prod-service-review-dev - infra-prod-service-gitea + - infra-prod-service-codesearch - infra-prod-remote-puppet-afs - infra-prod-remote-puppet-else periodic: @@ -2697,6 +2747,7 @@ - infra-prod-service-review - infra-prod-service-review-dev - infra-prod-service-gitea + - infra-prod-service-codesearch - infra-prod-remote-puppet-afs opendev-prod-hourly: jobs: diff --git a/inventory/groups.yaml b/inventory/groups.yaml index 117bd21ffb..b37a96a8b6 100644 --- a/inventory/groups.yaml +++ b/inventory/groups.yaml @@ -28,6 +28,8 @@ groups: # backup-server: # - backup[0-9]*.opendev.org cacti: cacti[0-9]*.open*.org + codesearch: + - codesearch[0-9]*.open*.org control-plane-clouds: - bridge.openstack.org disabled: diff --git a/manifests/codesearch.pp b/manifests/codesearch.pp new file mode 100644 index 0000000000..41f45cdb9a --- /dev/null +++ b/manifests/codesearch.pp @@ -0,0 +1,5 @@ +# Node-OS: xenial +node /^codesearch\d*\.open.*\.org$/ { + $group = "codesearch" + class { 'openstack_project::codesearch': } +} diff --git a/manifests/site.pp b/manifests/site.pp index 3f1785c97f..dd547d62c7 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -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 diff --git a/modules/openstack_project/manifests/codesearch.pp b/modules/openstack_project/manifests/codesearch.pp index c1cac3d2bd..8a5212e24b 100644 --- a/modules/openstack_project/manifests/codesearch.pp +++ b/modules/openstack_project/manifests/codesearch.pp @@ -1,11 +1,5 @@ # Class to configure hound on a node. -class openstack_project::codesearch ( - $project_config_repo, -) { - - class { 'project_config': - url => $project_config_repo, - } +class openstack_project::codesearch { class { 'hound': 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', environment => [ '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 => [ File['/usr/local/bin/resync-hound-config'], diff --git a/playbooks/remote_puppet_else.yaml b/playbooks/remote_puppet_else.yaml index 76e73b5e60..e014c7abc1 100644 --- a/playbooks/remote_puppet_else.yaml +++ b/playbooks/remote_puppet_else.yaml @@ -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" strategy: free roles: diff --git a/playbooks/service-codesearch.yaml b/playbooks/service-codesearch.yaml new file mode 100644 index 0000000000..117b096d16 --- /dev/null +++ b/playbooks/service-codesearch.yaml @@ -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