From c98505c8f28096ad66ed8554c3456987e813228a Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 19 Jan 2021 15:48:23 +1100 Subject: [PATCH] Manage afsdb servers with Ansible Move common setup steps into a openafs-server-config role, and create openafs-file-server and openafs-db-server roles to manage fileserver and db servers respectively. Modify the playbook to run these roles against the AFS servers. Change-Id: I4e80ad8ffe1d4992e405ea516b8762109758d7eb --- inventory/service/groups.yaml | 4 ---- playbooks/roles/openafs-db-server/README.rst | 1 + playbooks/roles/openafs-db-server/tasks/main.yaml | 10 ++++++++++ playbooks/roles/openafs-file-server/README.rst | 1 + playbooks/roles/openafs-file-server/tasks/main.yaml | 11 +++++++++++ .../README.rst | 0 .../files/CellServDB | 0 .../files/ThisCell | 0 .../tasks/main.yaml | 8 -------- playbooks/service-afs.yaml | 12 +++--------- 10 files changed, 26 insertions(+), 21 deletions(-) create mode 100644 playbooks/roles/openafs-db-server/README.rst create mode 100644 playbooks/roles/openafs-db-server/tasks/main.yaml create mode 100644 playbooks/roles/openafs-file-server/README.rst create mode 100644 playbooks/roles/openafs-file-server/tasks/main.yaml rename playbooks/roles/{openafs-server => openafs-server-config}/README.rst (100%) rename playbooks/roles/{openafs-server => openafs-server-config}/files/CellServDB (100%) rename playbooks/roles/{openafs-server => openafs-server-config}/files/ThisCell (100%) rename playbooks/roles/{openafs-server => openafs-server-config}/tasks/main.yaml (93%) diff --git a/inventory/service/groups.yaml b/inventory/service/groups.yaml index b21282bf12..1f1237e7b5 100644 --- a/inventory/service/groups.yaml +++ b/inventory/service/groups.yaml @@ -142,8 +142,6 @@ groups: pbx: - pbx[0-9]*.opendev.org puppet: - - afsdb01.openstack.org - - afsdb02.openstack.org - ask*.open*.org - backup[0-9]*.openstack.org - cacti[0-9]*.open*.org @@ -176,8 +174,6 @@ groups: - wiki-dev[0-9]*.openstack.org - wiki[0-9]*.openstack.org puppet4: - - afsdb01.openstack.org - - afsdb02.openstack.org - ask*.open*.org - ask-staging[0-9]*.open*.org - cacti[0-9]*.open*.org diff --git a/playbooks/roles/openafs-db-server/README.rst b/playbooks/roles/openafs-db-server/README.rst new file mode 100644 index 0000000000..9c038afc99 --- /dev/null +++ b/playbooks/roles/openafs-db-server/README.rst @@ -0,0 +1 @@ +Configure a host as an AFS db server (pts/vldb) diff --git a/playbooks/roles/openafs-db-server/tasks/main.yaml b/playbooks/roles/openafs-db-server/tasks/main.yaml new file mode 100644 index 0000000000..96f44b3b0f --- /dev/null +++ b/playbooks/roles/openafs-db-server/tasks/main.yaml @@ -0,0 +1,10 @@ +- name: Include config + include_role: + name: openstack-server-config + +- name: Install packages + package: + name: + - openafs-dbserver + - openafs-krb5 + state: latest diff --git a/playbooks/roles/openafs-file-server/README.rst b/playbooks/roles/openafs-file-server/README.rst new file mode 100644 index 0000000000..fe42875e7a --- /dev/null +++ b/playbooks/roles/openafs-file-server/README.rst @@ -0,0 +1 @@ +Configure a host as an AFS fileserver diff --git a/playbooks/roles/openafs-file-server/tasks/main.yaml b/playbooks/roles/openafs-file-server/tasks/main.yaml new file mode 100644 index 0000000000..e75cc9ee2c --- /dev/null +++ b/playbooks/roles/openafs-file-server/tasks/main.yaml @@ -0,0 +1,11 @@ +- name: Include config + include_role: + name: openstack-server-config + +- name: Install packages + package: + name: + - openafs-fileserver + - openafs-client + - openafs-krb5 + state: latest diff --git a/playbooks/roles/openafs-server/README.rst b/playbooks/roles/openafs-server-config/README.rst similarity index 100% rename from playbooks/roles/openafs-server/README.rst rename to playbooks/roles/openafs-server-config/README.rst diff --git a/playbooks/roles/openafs-server/files/CellServDB b/playbooks/roles/openafs-server-config/files/CellServDB similarity index 100% rename from playbooks/roles/openafs-server/files/CellServDB rename to playbooks/roles/openafs-server-config/files/CellServDB diff --git a/playbooks/roles/openafs-server/files/ThisCell b/playbooks/roles/openafs-server-config/files/ThisCell similarity index 100% rename from playbooks/roles/openafs-server/files/ThisCell rename to playbooks/roles/openafs-server-config/files/ThisCell diff --git a/playbooks/roles/openafs-server/tasks/main.yaml b/playbooks/roles/openafs-server-config/tasks/main.yaml similarity index 93% rename from playbooks/roles/openafs-server/tasks/main.yaml rename to playbooks/roles/openafs-server-config/tasks/main.yaml index 47dd9d7fb6..ba0fcb5178 100644 --- a/playbooks/roles/openafs-server/tasks/main.yaml +++ b/playbooks/roles/openafs-server-config/tasks/main.yaml @@ -75,11 +75,3 @@ name: openafs-modules-dkms state: latest install_recommends: no - -- name: Install packages - package: - name: - - openafs-fileserver - - openafs-client - - openafs-krb5 - state: latest diff --git a/playbooks/service-afs.yaml b/playbooks/service-afs.yaml index c1f517a92b..57377d9377 100644 --- a/playbooks/service-afs.yaml +++ b/playbooks/service-afs.yaml @@ -1,19 +1,13 @@ -- hosts: 'localhost:!disabled' - name: Install puppet role/modules - strategy: linear - roles: - - puppet-setup-ansible - - hosts: "afsdb:!disabled" - name: "AFS: run puppet on the AFS servers" + name: "AFS: configure db servers" strategy: free roles: - - puppet-run + - openafs-db-server - hosts: "afs:!disabled" name: "Configure AFS server" roles: - - openafs-server + - openafs-file-server - hosts: "mirror-update:!disabled" name: "Create key for remote vos release"