Skip to content

prakhar1985/ansible_homework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Homework Automation

Prepare Envniorment

  • Order Ansible Tower Lab

    • Services → Catalogs → OPENTLC Automation → Ansible Tower Lab

  • Order Openstack Lab Enviorment

    • Services → Catalogs → OPENTLC Automation → Openstack for Ansible

  • Wait for the envs to be up.

Playbook for homework

  • Run site-homework.yml to complete homework

    • Playbook will do the following

      1. Prepare workstation-{{osp_GUID}}}.rhpds.opentlc.com

        1. Setup ssh keys for cloud-user

        2. Install shade library

        3. Create clouds.yaml file for connecting to api of OSP

      2. Install Ansible Tower on 3 nodes

      3. Install Ansible Tower Isolated node on workstation-{{osp_GUID}}}.rhpds.opentlc.com

      4. Connfigure tower:

        1. Install tower-cli

        2. Create Project

        3. Create required credentials

        4. Create job templates

        5. Create workflow template

export TOWER_GUID=<Tower guid from mail>
export OSP_GUID=<OSP GUID from mail>
export SSO_LOGIN=<username-company.com>
export SSO_KEY=~/.ssh/key.pem
export WORKDIR=/Users/<username>/homework-assignment-automation/
export SSO_PASSWORD=<your openlc account password>
exxport JQ_REPO_BASE=http://www.opentlc.com/download/ansible_bootcamp

###### Create local inventory

# mkdir ${WORKDIR}/inventory

# cat << EOF > ${WORKDIR}/inventory/inventory_local
[bastion_tower]
bastion.${TOWER_GUID}.example.opentlc.com

[workstation]
workstation-${OSP_GUID}.rhpds.opentlc.com

[all:vars]
ansible_user=${SSO_LOGIN}
ansible_ssh_private_key_file=${SSO_KEY}
ansible_ssh_common_args='-o StrictHostKeyChecking=no'

EOF

# ansible-playbook  site-homework.yml -e tower_GUID=${TOWER_GUID} -e osp_GUID=${OSP_GUID} -e sso_login=${SSO_LOGIN} -e path_to_sso_key=${SSO_KEY} -e workdir=${WORKDIR} -e param_repo_base=${JQ_REPO_BASE} -e sso_password=${SSO_PASSWORD} --ask-vault-pass

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published