-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Break cloud-setup into phases (SOC-9077)
Currently the cloud-setup.yml, and associated cloud-setup role, is somewhat monolithic in that it does everything all in one go. Splitting this up into a set of phases that can be run independently will make it easier to implement more advanced workflows, e.g. update or upgrade, where we may want to perform specific phases more than once with different settings. Added ardana-nodes.yml top level playbook which dynamically creates host groups for nodes based upon the ardana_family and ardana_distro values detected for each node. Including this into a top level playbook will allow subsequent use of the ardana_suse, ardana_sles, etc host lists. Fixed astack-ssh-config generation to correctly add a 'deployer' host alias if the deployer node is not called 'deployer'; this was dropped by a previous change. Switch to using the zypper_repository module instead of running the raw zypper addrepo and zypper refresh commands, now that there is support available for setting up repos in the desired way. Added support for -v flag to bin/ardana-vagrant-ansible. Switch from using --skip-tags arguments to using an ansible variable to indicate whether the ardana-init related setup actions should be skipped as ansible tags can't easily be manilupdated from inside the ansible code base itself. Add bin/ardana as a utility that can be used to run arbitrary commands with the appropriate environment variables set. Switch to using the 'is' operator to check result status values, such as success, failed, changed or skipped, in preparation for moving to newer ansible versions. For example a when condition expression such as "not (item | skipped)" becomes "item is not skipped". Note that the files area under the cloud-rhel-deployer is excluded from suc changes due to that code being uploaded to the deployer and being run under Ansible 1.9. Fix various trailing whitespace issues. Change-Id: I513816674d5b2cfdd3980ee6f16972b2c6954dff
- Loading branch information
Fergal Mc Carthy
committed
Jul 2, 2019
1 parent
8cd2c7c
commit a1e18d9
Showing
57 changed files
with
916 additions
and
704 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# | ||
# (c) Copyright 2018 SUSE LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
# Playbook to dynamically group nodes by linux distribution family & flavour | ||
# deployment. | ||
--- | ||
|
||
- hosts: cloud | ||
tasks: | ||
- group_by: | ||
key: ardana_{{ ardana_distro }} | ||
parents: | ||
- ardana_{{ ardana_family }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# | ||
# (c) Copyright 2019 SUSE LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
# Setup buildservice (IBS and/or OBS) repos for appropriate cloud nodes | ||
--- | ||
|
||
- import_playbook: ardana-nodes.yml | ||
|
||
- hosts: ardana_suse | ||
tasks: | ||
- name: Setup IBS & OBS repos | ||
import_role: | ||
name: suse-buildservice-repos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# (c) Copyright 2019 SUSE LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
# Install/Update SOC/CLM on the deployer node. | ||
--- | ||
|
||
- hosts: deployer | ||
tasks: | ||
- name: Install/Update Ardana | ||
import_role: | ||
name: cloud-deployer-init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# (c) Copyright 2019 SUSE LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
# Setup local repos on the deployer node. | ||
--- | ||
|
||
- hosts: deployer | ||
tasks: | ||
- name: Setup deployer node repos | ||
import_role: | ||
name: cloud-deployer-repos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# | ||
# (c) Copyright 2019 SUSE LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
--- | ||
|
||
- hosts: cloud | ||
tasks: | ||
- name: Refresh all package repos on all cloud nodes | ||
import_role: | ||
name: cloud-refresh-repos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# | ||
# (c) Copyright 2019 SUSE LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
--- | ||
|
||
- hosts: cloud:!deployer | ||
tasks: | ||
- name: Setup package repos on non-deployer nodes | ||
import_role: | ||
name: cloud-remote-repos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# | ||
# (c) Copyright 2019 SUSE LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
# Update the repos on the cloud nodes; should only be used on a cloud | ||
# whose deployer has already been ardana-init'd as it expects that the | ||
# deployer is configured to service the relevant repos via port 79. | ||
--- | ||
|
||
- import_playbook: cloud-buildservice-repos.yml | ||
|
||
- import_playbook: cloud-deployer-repos.yml | ||
|
||
- import_playbook: cloud-remote-repos.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# | ||
# (c) Copyright 2019 SUSE LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
# Basic Ardana cloud settings | ||
--- | ||
|
||
ardana_family: "{{ ansible_os_family.split(' ')[0] | lower | replace('open','') }}" | ||
ardana_distro: >- | ||
{%- set _d = 'unknown' -%} | ||
{%- if ardana_family == 'suse' -%} | ||
{%- set _d = 'sles' -%} | ||
{%- elif ardana_family == 'redhat' -%} | ||
{%- set _d = 'rhel' -%} | ||
{%- endif -%} | ||
{{- _d -}} |
Oops, something went wrong.