Skip to content

Commit

Permalink
New config smart-management-foundations for the corresponding course (#…
Browse files Browse the repository at this point in the history
…3107)

* adding config for smart-man foundations

* removing manifest file from public view
  • Loading branch information
wilson-walrus authored Oct 27, 2020
1 parent 5be2ab8 commit e7a4ceb
Show file tree
Hide file tree
Showing 20 changed files with 952 additions and 0 deletions.
194 changes: 194 additions & 0 deletions ansible/configs/smart-management-foundations/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
:config: smart-management
:author1: Mitesh The Mouse <[email protected]>
:author2: Prakhar Srivastava <[email protected]>
:author3: Tony Kay <[email protected]>
:team: GPTE DevOps & Automation

Config Name: {config}
=====================

The {config} config deploys bastion, Ansible tower, Satellite and RHEL host on OpenStack cloud providers.


Requirements
------------

* Following are the requirements:
. Yum repositories are required for bastion and satellite host.
. OSP credentials are required.
. openstacksdk and apypie python modules required.
Config Variables
----------------

. Cloud specfic settings related variables.
+
[cols="4",options="header"]
|===
|*Variable* | *State* | *Default* |*Description*
| env_type: "string"| Required | None| Name of the config (smart-management)
| output_dir: "path string" |Required | /tmp/workdir | Writable working scratch directory
| email: "string" | Required | [email protected] | User info for notifications
| guid: "string" | Reqired |defaultguid |Unique identifier
| cloud_provider: "string" |Required | osp | Which AgnosticD Cloud Provider to use
|rhel_repos: [list] |Required | Default | List for rhel repos
|===

. Tower specfic variables.
+
[cols="4",options="header"]
|===
|*Variable* | *State* | *Default* | *Description*
|tower_version: 'digits' | Required | None | Tower version for installation
|tower_admin_password: "string" | Optional | Auto | Tower admin password
|software_to_deploy: "string" | Required | tower | Tower installation playbook
| tower_default_workloads: [list] | Required | [tower-license-injector, cleanup-tower-default] | Default workload (list of roles)
| tower_infra_workloads: [list] | Required | None | Infra workload (list of roles)
|===
+
[NOTE]
For role related variables, read Tower role's README.adoc.

. Satellite specfic variables.
+
[cols="4",options="header"]
|===
|*Variable* | *State* | *Default* |*Description*
|install_satellite: Bool | Required | True | To enable installation roles
|configure_satellite: Bool |Required | False | To enable configuration roles
|satellite_version: "Digit" |Required | 6.7 |satellite version
|satellite_repos: [list] |Required | Default for 6.7 | List for satellite repos
|org: "String" |Required | None |Organization name
|org_label: "String" |Required | None | Organization label in string without space
|org_description: "String" |Required | None | Organization description
|===
+
[NOTE]
For role related variables, read satellite role's README.adoc.

Example variables and values
----------------------------

. Sample of sample_osp_vars.yml
+
[source=text]
----
[user@desktop ~]$ cd agnosticd/ansible
[user@desktop ~]$ cat ./configs/smart-management/sample_osp_vars.yml
guid: defaultguid
osp_cluster_dns_zone: red.osp.opentlc.com
admin_user: opentlc-mgr
student_name: student
student_password: "changeme"
tower_version: "3.6.4-1"
software_to_deploy: tower
tower_infra_workloads:
- tower-org-create
tower_organization:
- name: gpte
configure_satellite: true
satellite_version: 6.7
satellite_infra_workloads:
- satellite-manage-organization
- satellite-manage-manifest
org: gpte
org_label: gpte
org_description: "Global Partner Training and Enablement"
----
+
[NOTE]
For reference link:sample_vars_osp.yml[click] here.

. Sample of secrets.yml
+
[source=text]
----
[user@desktop ~]$ cat ~/secrets.yml
osp_auth_url: http://x.x.x.x:5000/v3
osp_auth_username: admin
osp_auth_password: "xxxxxxxxxxxxxxxxxxxxxxxxx"
osp_auth_project_domain: "default"
osp_auth_user_domain: "default"
osp_cluster_dns_zone: xxxxxxx.osp.opentlc.com
ddns_key_name: xxxxxxxxxxxxx
ddns_key_secret: "xxxxxxxxxxxxxxxxxxxxxx"
own_repo_path: http://some.yum.com/repos/
satellite_manifest:
type: file
path: ~/manifest_satellite-infrastructure-may-2020.zip
tower_license: >
{
"subscription_name": "Ansible Tower by Red Hat, Standard (50 Managed Nodes)",
"eula_accepted": true,
"instance_count": 50,
"trial": false,
"contact_email": "[email protected]",
"company_name": "Red Hat, Inc",
"license_type": "enterprise",
"contact_name": "Tony Kay",
"license_date": 1640926800,
"license_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
----


Tags
---
. List of tags used in {config} config-
+
[cols="2",options="header"]
|===
| Tag | Description
|install_satellite |Consistent tag for all satellite installation roles
|configure_satellite |Consistent tag for all satellite configuration roles
|install-tower | Consistent tag for all tower installation tasks
|tower-cli | Consistent tag for all tower-cli tasks
|===

. Examples how to use tags
+
----
## Tagged jobs
[user@desktop ~]$ ansible-playbook playbook.yml --tags configure_satellite

## Skip tagged jobs
[user@desktop ~]$ ansible-playbook playbook.yml --skip-tags install_satellite,install-tower
----

Examples, How to use config
---------------------------

. How to deploy {config} config.
+
[source=text]
----
[user@desktop ~]$ cd agnosticd/ansible
[user@desktop ~]$ ansible-playbook main.yml \
-e @./configs/smart-management/sample_vars_osp.yml \
-e @~/secrets.yml \
-e guid=<Alphanum>
----

. How to destroy deployed environment
+
[source=text]
----
[user@desktop ~]$ cd agnosticd/ansible
[user@desktop ~]$ ansible-playbook ./configs/smart-management/destroy.yml \
-e @./configs/smart-management/sample_vars_osp.yml \
-e @~/secrets.yml \
-e guid=defaultguid
----

Author Information
------------------

* Author/owner:
** {author1}
* Alternative Contacts:
** {author2}
** {author3}
* Team:
** {team}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
- name: Enable Satellite repositories
theforeman.foreman.repository_set:
username: "{{ satellite_admin }}"
password: "{{ satellite_admin_password }}"
server_url: "https://{{ publicname }}"
organization: "{{ org }}"
label: "{{ __repo_list.label }}"
repositories:
- releasever: "{{ __repo_list.release | default(omit) }}"
basearch: "{{ __repo_list.basearch | default('x86_64') }}"
loop: "{{ satellite_repos_sync }}"
loop_control:
loop_var: __repo_list
tags:
- configure_satellite
- configure_satellite_sync

- when: satellite_sync_repos | bool
name: Sync Repos to the Satellite
block:
- name: Sync enabled repositories by product
theforeman.foreman.repository_sync:
username: "{{ satellite_admin }}"
password: "{{ satellite_admin_password }}"
server_url: "https://{{ publicname }}"
organization: "{{ org }}"
repository: "{{ __repo_sync.name | default(omit) }}"
product: "{{ __repo_sync.product }}"
loop: "{{ satellite_products }}"
loop_control:
loop_var: __repo_sync
async: 999999
poll: 0
register: repo_sync_sleeper
tags:
- configure_satellite
- configure_satellite_sync

- name: Wait until all Syncs have finished
async_status:
jid: "{{ repo_sync_sleeper_item.ansible_job_id }}"
loop: "{{ repo_sync_sleeper.results }}"
loop_control:
loop_var: repo_sync_sleeper_item
when: repo_sync_sleeper_item.ansible_job_id is defined # Skip items that were skipped in the previous task
register: async_job_result
until: async_job_result.finished
retries: 999
delay: 20
tags:
- configure_satellite
- configure_satellite_sync
64 changes: 64 additions & 0 deletions ansible/configs/smart-management-foundations/default_vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---

env_type: smart-management-foundations
output_dir: /tmp/workdir # Writable working scratch directory
email: "{{env_type}}@example.com"
guid: defaultguid

satellite_version: "6.7"

satellite_lab_setup: true
satellite_sync_repos: true
satellite_org_set_default: true

deploy_local_ssh_config_location: "{{output_dir}}/"
key_name: ocpkey # Keyname must exist in AWS
use_own_key: true
env_authorized_key: "{{guid}}key"
set_env_authorized_key: true
default_key_name: ~/.ssh/{{key_name}}.pem

install_bastion: true
install_common: true
install_ipa_client: false

tower_run: false

update_packages: true

install_satellite: true
configure_satellite: false

project_tag: "{{ env_type }}-{{ guid }}"

# ##### Repos for satellite 6.7 ###########
# satellite_repos:
# - rhel-7-server-rpms
# - rhel-7-server-satellite-6.7-rpms
# - rhel-7-server-satellite-maintenance-6-rpms
# - rhel-7-server-satellite-capsule-6.7-rpms
# - rhel-7-server-satellite-tools-6.7-rpms
# - rhel-server-rhscl-7-rpms
# - rhel-7-server-ansible-2.9-rpms

# ####### RHEL repos ###########
# rhel_repos:
# - rhel-7-server-rpms
# - rhel-server-rhscl-7-rpms
# - rhel-7-server-extras-rpms

common_packages:
- python2
- unzip
- bash-completion
- tmux
- bind-utils
- wget
- git
- vim-enhanced
- at
- ansible

satellite_default_workloads:
- satellite-public-hostname
- satellite-installation
Loading

0 comments on commit e7a4ceb

Please sign in to comment.