From efe8d4eac79c1f00fc29132b62d23f6deb538581 Mon Sep 17 00:00:00 2001 From: sborenst Date: Tue, 27 Nov 2018 15:41:30 +1100 Subject: [PATCH] [WIP] Get rid of workdir More /opt/workshop changes Mass remove vars_files, pray for us Added more ANSIBLE_REPO_PATH to be removed Co-authored-by: Prakhar Srivastava --- ansible/ansible.cfg | 9 - .../terraform_ec2_ssh_config_setup.yml | 3 - ansible/cloud_providers/azure_destroy_env.yml | 2 +- .../azure_infrastructure_deployment.yml | 10 +- .../azure_ssh_config_setup.yml | 2 +- .../common_ssh_config_setup.yml | 4 +- .../ec2_infrastructure_deployment.yml | 18 +- .../cloud_providers/ec2_ssh_config_setup.yml | 2 +- ansible/configs/ans-tower-lab/README.adoc | 4 +- ansible/configs/ans-tower-lab/destroy_env.yml | 6 +- ansible/configs/ans-tower-lab/post_infra.yml | 6 +- .../configs/ans-tower-lab/post_software.yml | 40 ++-- ansible/configs/ans-tower-lab/pre_infra.yml | 12 +- .../configs/ans-tower-lab/pre_software.yml | 52 ++--- ansible/configs/ansible-cicd-lab/README.adoc | 8 +- .../configs/ansible-cicd-lab/destroy_env.yml | 10 +- ansible/configs/ansible-cicd-lab/env_vars.yml | 2 +- .../configs/ansible-cicd-lab/post_infra.yml | 6 +- .../ansible-cicd-lab/post_software.yml | 30 +-- .../configs/ansible-cicd-lab/pre_infra.yml | 16 +- .../configs/ansible-cicd-lab/pre_software.yml | 30 +-- .../configs/ansible-provisioner/README.adoc | 2 +- .../ansible-provisioner/destroy_env.yml | 2 +- .../ansible-provisioner/post_infra.yml | 6 +- .../ansible-provisioner/post_software.yml | 30 +-- .../configs/ansible-provisioner/pre_infra.yml | 6 +- .../ansible-provisioner/pre_software.yml | 6 +- .../archive/ans-network-lab/pre_software.yml | 63 ------ .../ansible-tower-terraform/pre_software.yml | 33 --- .../auth-playground-lab/pre_software.yml | 79 -------- .../archive/generic-example/destroy_env.yml | 3 - .../archive/generic-example/pre_software.yml | 63 ------ .../archive/linklight-demo/README.adoc | 12 +- .../archive/linklight-demo/destroy_env.yml | 8 +- .../archive/linklight-demo/post_infra.yml | 24 +-- .../archive/linklight-demo/post_software.yml | 16 +- .../archive/linklight-demo/pre_infra.yml | 36 ++-- .../archive/linklight-demo/pre_software.yml | 26 +-- .../archive/linklight-engine/README.adoc | 10 +- .../archive/linklight-engine/destroy_env.yml | 8 +- .../archive/linklight-engine/post_infra.yml | 24 +-- .../linklight-engine/post_software.yml | 16 +- .../archive/linklight-engine/pre_infra.yml | 20 +- .../archive/linklight-engine/pre_software.yml | 26 +-- .../linklight-networking-allcisco/README.adoc | 10 +- .../destroy_env.yml | 8 +- .../post_infra.yml | 24 +-- .../post_software.yml | 16 +- .../pre_infra.yml | 32 +-- .../pre_software.yml | 26 +-- .../archive/linklight-networking/README.adoc | 10 +- .../linklight-networking/destroy_env.yml | 8 +- .../linklight-networking/post_infra.yml | 24 +-- .../linklight-networking/post_software.yml | 16 +- .../linklight-networking/pre_infra.yml | 32 +-- .../linklight-networking/pre_software.yml | 26 +-- .../ocp-adv-deploy-hw/pre_software.yml | 74 ------- .../ocp-implementation-lab-2/pre_software.yml | 62 ------ .../ravello-bastion-setup/ssh_vars.yml | 1 - .../archive/rhte-ansible-net/README.adoc | 10 +- .../archive/rhte-ansible-net/destroy_env.yml | 8 +- .../archive/rhte-ansible-net/post_infra.yml | 24 +-- .../rhte-ansible-net/post_software.yml | 16 +- .../archive/rhte-ansible-net/pre_infra.yml | 32 +-- .../archive/rhte-ansible-net/pre_software.yml | 26 +-- .../configs/archive/single-ipa/ssh_vars.yml | 1 - .../archive/three-tier-tower/README.adoc | 4 +- .../archive/three-tier-tower/destroy_env.yml | 2 +- .../archive/three-tier-tower/env_vars.yml | 2 +- .../archive/three-tier-tower/post_infra.yml | 6 +- .../three-tier-tower/post_software.yml | 16 +- .../archive/three-tier-tower/pre_infra.yml | 16 +- .../archive/three-tier-tower/pre_software.yml | 26 +-- ansible/configs/bu-workshop/cleanup.yml | 14 +- .../bu-workshop/files/userprovision.yaml | 2 +- ansible/configs/bu-workshop/post_software.yml | 76 +++---- ansible/configs/bu-workshop/ssh_vars.yml | 2 +- .../just-some-nodes-example/README.adoc | 4 +- .../just-some-nodes-example/destroy_env.yml | 4 +- .../just-some-nodes-example/env_vars.yml | 2 +- .../just-some-nodes-example/pre_software.yml | 10 +- .../just-some-nodes-example/software.yml | 2 +- .../configs/linklight-foundations/README.adoc | 12 +- .../linklight-foundations/destroy_env.yml | 8 +- .../linklight-foundations/post_infra.yml | 24 +-- .../linklight-foundations/post_software.yml | 16 +- .../linklight-foundations/pre_infra.yml | 30 +-- .../linklight-foundations/pre_software.yml | 26 +-- ansible/configs/linklight/README.adoc | 12 +- ansible/configs/linklight/destroy_env.yml | 8 +- ansible/configs/linklight/post_infra.yml | 24 +-- ansible/configs/linklight/post_software.yml | 16 +- ansible/configs/linklight/pre_infra.yml | 46 ++--- ansible/configs/linklight/pre_software.yml | 26 +-- ansible/configs/ocp-clientvm/README.adoc | 38 ++-- ansible/configs/ocp-clientvm/env_vars.yml | 6 +- ansible/configs/ocp-clientvm/pre_software.yml | 22 +- ansible/configs/ocp-clientvm/software.yml | 2 +- .../configs/ocp-gpu-single-node/README.adoc | 12 +- .../ocp-gpu-single-node/destroy_env.yml | 10 +- .../configs/ocp-gpu-single-node/env_tests.yml | 2 +- .../configs/ocp-gpu-single-node/exports.sh | 2 +- .../ocp-gpu-single-node/post_infra.yml | 34 ++-- .../ocp-gpu-single-node/post_software.yml | 22 +- .../configs/ocp-gpu-single-node/pre_infra.yml | 6 +- .../ocp-gpu-single-node/pre_software.yml | 46 ++--- .../configs/ocp-gpu-single-node/scaleup.yml | 80 ++++---- .../ocp-ha-disconnected-lab/README.adoc | 6 +- .../ocp-ha-disconnected-lab/aws_test.yml | 2 - .../ocp-ha-disconnected-lab/destroy_env.yml | 6 +- .../ocp-ha-disconnected-lab/post_infra.yml | 6 +- .../post_ocp_nfs_config.yml | 12 +- .../ocp-ha-disconnected-lab/post_software.yml | 42 ++-- .../ocp-ha-disconnected-lab/pre_infra.yml | 6 +- .../ocp-ha-disconnected-lab/pre_software.yml | 52 ++--- ansible/configs/ocp-ha-lab/README.adoc | 4 +- .../ocp-ha-lab/post_ocp_nfs_config.yml | 4 +- ansible/configs/ocp-ha-lab/post_software.yml | 24 +-- ansible/configs/ocp-ha-lab/pre_software.yml | 18 +- .../ocp-implementation-lab/README.adoc | 4 +- .../ocp-implementation-lab/destroy_env.yml | 6 +- .../ocp-implementation-lab/post_infra.yml | 6 +- .../post_ocp_nfs_config.yml | 12 +- .../ocp-implementation-lab/post_software.yml | 32 +-- .../ocp-implementation-lab/pre_infra.yml | 6 +- .../ocp-implementation-lab/pre_software.yml | 42 ++-- .../ocp-multi-cloud-example/README.adoc | 6 +- .../ocp-multi-cloud-example/destroy_env.yml | 10 +- .../ocp-multi-cloud-example/env_tests.yml | 2 +- .../ocp-multi-cloud-example/packer.adoc | 2 +- .../ocp-multi-cloud-example/packer.json | 2 +- .../ocp-multi-cloud-example/post_infra.yml | 34 ++-- .../ocp-multi-cloud-example/post_software.yml | 4 +- .../ocp-multi-cloud-example/pre_infra.yml | 6 +- .../ocp-multi-cloud-example/pre_software.yml | 42 ++-- .../ocp-multi-cloud-example/scaleup.yml | 80 ++++---- ansible/configs/ocp-storage-cns/README.adoc | 4 +- .../configs/ocp-storage-cns/destroy_env.yml | 6 +- .../configs/ocp-storage-cns/post_infra.yml | 6 +- .../ocp-storage-cns/post_ocp_nfs_config.yml | 12 +- .../configs/ocp-storage-cns/post_software.yml | 32 +-- ansible/configs/ocp-storage-cns/pre_infra.yml | 6 +- .../configs/ocp-storage-cns/pre_software.yml | 44 ++-- .../configs/ocp-workloads/ocp-workload.yml | 6 +- ansible/configs/ocp-workshop/README.adoc | 10 +- ansible/configs/ocp-workshop/destroy_env.yml | 8 +- ansible/configs/ocp-workshop/env_tests.yml | 2 +- .../configs/ocp-workshop/ocp_workloads.yml | 10 +- ansible/configs/ocp-workshop/post_infra.yml | 10 +- .../configs/ocp-workshop/post_software.yml | 166 ++++++++-------- ansible/configs/ocp-workshop/pre_infra.yml | 6 +- ansible/configs/ocp-workshop/pre_software.yml | 60 +++--- ansible/configs/ocp-workshop/scaleup.yml | 26 +-- .../configs/ocp4-coreos-deployer/README.adoc | 4 +- .../ocp4-coreos-deployer/destroy_env.yml | 6 +- .../ocp4-coreos-deployer/post_infra.yml | 6 +- .../ocp4-coreos-deployer/post_software.yml | 10 +- .../ocp4-coreos-deployer/pre_infra.yml | 6 +- .../ocp4-coreos-deployer/pre_software.yml | 46 ++--- .../configs/ocp4-coreos-deployer/software.yml | 14 +- ansible/configs/openshift-demos/idle.yml | 8 +- .../openshift-demos/imagebuild-pipeline.yml | 2 +- .../openshift-demos/msa-cicd-eap-full.yml | 18 +- .../openshift-demos/msa-cicd-eap-min.yml | 18 +- ansible/configs/openshift-demos/msa-full.yml | 10 +- ansible/configs/openshift-demos/msa-min.yml | 10 +- ansible/configs/openshift-demos/undeploy.yml | 8 +- ansible/configs/openshift-demos/unidle.yml | 2 +- ansible/configs/quay-enterprise/README.adoc | 4 +- .../configs/quay-enterprise/destroy_env.yml | 6 +- ansible/configs/quay-enterprise/env_vars.yml | 4 +- .../configs/quay-enterprise/post_infra.yml | 6 +- .../configs/quay-enterprise/post_software.yml | 10 +- ansible/configs/quay-enterprise/pre_infra.yml | 6 +- .../configs/quay-enterprise/pre_software.yml | 44 ++-- ansible/configs/quay-enterprise/software.yml | 48 ++--- ansible/configs/rhte-lb/README.adoc | 4 +- ansible/configs/rhte-lb/destroy_env.yml | 6 +- ansible/configs/rhte-lb/post_infra.yml | 6 +- ansible/configs/rhte-lb/post_software.yml | 10 +- ansible/configs/rhte-lb/pre_infra.yml | 6 +- ansible/configs/rhte-lb/pre_software.yml | 46 ++--- ansible/configs/rhte-lb/software.yml | 10 +- .../configs/rhte-oc-cluster-vms/README.adoc | 4 +- .../rhte-oc-cluster-vms/destroy_env.yml | 6 +- .../rhte-oc-cluster-vms/post_infra.yml | 6 +- .../rhte-oc-cluster-vms/post_software.yml | 12 +- .../configs/rhte-oc-cluster-vms/pre_infra.yml | 6 +- .../rhte-oc-cluster-vms/pre_software.yml | 46 ++--- .../configs/rhte-oc-cluster-vms/software.yml | 14 +- ansible/configs/rhte-ocp-workshop/README.adoc | 8 +- .../configs/rhte-ocp-workshop/destroy_env.yml | 10 +- .../configs/rhte-ocp-workshop/env_tests.yml | 2 +- .../configs/rhte-ocp-workshop/post_infra.yml | 46 ++--- .../rhte-ocp-workshop/post_software.yml | 188 +++++++++--------- .../configs/rhte-ocp-workshop/pre_infra.yml | 6 +- .../rhte-ocp-workshop/pre_software.yml | 70 +++---- ansible/configs/rhte-ocp-workshop/scaleup.yml | 80 ++++---- .../simple-multi-cloud-example/README.adoc | 4 +- .../destroy_env.yml | 10 +- .../simple-multi-cloud-example/env_vars.yml | 2 +- .../simple-multi-cloud-example/post_infra.yml | 6 +- .../post_software.yml | 16 +- .../simple-multi-cloud-example/pre_infra.yml | 16 +- .../pre_software.yml | 26 +-- ansible/configs/three-tier-app/README.adoc | 4 +- .../configs/three-tier-app/destroy_env.yml | 2 +- ansible/configs/three-tier-app/env_vars.yml | 2 +- ansible/configs/three-tier-app/post_infra.yml | 6 +- .../configs/three-tier-app/post_software.yml | 16 +- ansible/configs/three-tier-app/pre_infra.yml | 16 +- .../configs/three-tier-app/pre_software.yml | 26 +-- ansible/destroy.yml | 2 +- ansible/include_vars.yml | 4 + ansible/install_galaxy_roles.yml | 4 +- ansible/main.yml | 14 +- ansible/roles/archived_roles/nodejs/README.md | 2 +- .../repositories/tasks/main.yml | 2 +- .../roles/bastion-opentlc-ipa/tasks/main.yml | 2 +- ansible/roles/bastion/tasks/main.yml | 6 +- ansible/roles/common/tasks/use_own_repos.yml | 2 +- ansible/roles/geerlingguy.gogs/README.md | 2 +- .../roles/host-ocp-installer/tasks/main.yml | 6 +- .../roles/host-ocp-provisioner/tasks/main.yml | 4 +- .../tasks/main.yml | 2 +- .../tasks/main.yml | 4 +- .../infra-ec2-template-create/tasks/main.yml | 4 +- .../tasks/locate_template.yml | 4 +- .../tasks/main.yml | 2 +- .../infra-local-create-ssh_key/tasks/main.yml | 10 +- ansible/roles/ocp-client-vm/README.md | 2 +- .../ocp-dynamic-nfs-provisioner/README.md | 2 +- .../ocp-infra-aws-service-broker/README.md | 6 +- ansible/roles/ocp-infra-nexus/README.md | 2 +- ansible/roles/ocp-infra-openwhisk/README.md | 6 +- .../ocp-workload-3scale-demo/readme.adoc | 6 +- .../readme.adoc | 4 +- .../ocp-workload-3scale-lifecycle/readme.adoc | 4 +- .../readme.adoc | 6 +- .../ocp-workload-amq-enmasse/readme.adoc | 4 +- .../ocp-workload-appdev-homework/readme.adoc | 6 +- .../ilt_provision.sh | 2 +- .../ocp-workload-appmod-migration/readme.adoc | 4 +- .../ocp-workload-bxms-dm/ilt_provision.sh | 2 +- .../roles/ocp-workload-bxms-dm/readme.adoc | 4 +- .../ocp-workload-bxms-pam/ilt_provision.sh | 2 +- .../roles/ocp-workload-bxms-pam/readme.adoc | 4 +- .../readme.adoc | 6 +- .../ocp-workload-dm7-qlb-demo/readme.adoc | 6 +- .../roles/ocp-workload-example/readme.adoc | 6 +- .../readme.adoc | 6 +- .../ocp-workload-fuse-ignite/ilt_provision.sh | 2 +- .../ocp-workload-fuse-on-ocp/ilt_provision.sh | 2 +- .../ocp-workload-fuse-on-ocp/readme.adoc | 4 +- .../ocp-workload-integreatly/readme.adoc | 6 +- .../roles/ocp-workload-iot-demo/readme.adoc | 6 +- .../ocp-workload-istio-community/readme.adoc | 4 +- .../readme.adoc | 6 +- .../ocp-workload-parksmap-demo/readme.adoc | 6 +- .../tasks/workload.yml | 2 +- .../ocp-workload-rhte-mw-api-biz/readme.adoc | 6 +- .../ilt_provision.sh | 2 +- .../ocp-workload-rhte-mw-api-mesh/readme.adoc | 4 +- .../readme.adoc | 4 +- .../ocp-workload-rhte-mw-msa-mesh/readme.adoc | 8 +- .../ilt_provision.sh | 2 +- .../readme.adoc | 4 +- .../ocp-workload-rhte-mw-op-intel/readme.adoc | 4 +- .../ocp-workload-starter-workshop/readme.adoc | 6 +- .../ocp-workload-vertx-reactica/readme.adoc | 4 +- .../set-repositories/tasks/file-repos.yml | 2 +- .../set_env_authorized_key/tasks/main.yml | 8 +- ansible/roles/tower_demo/tasks/main.yml | 8 +- .../README.adoc | 8 +- .../zabbix-client-openshift-node/README.adoc | 8 +- ansible/roles/zabbix-client/README.adoc | 8 +- .../software_playbooks/archive/hello_motd.yml | 76 ------- ansible/software_playbooks/none.yml | 4 +- ansible/software_playbooks/openshift.yml | 42 ++-- ansible/software_playbooks/tower.yml | 28 +-- .../archive/launch-inventory-sync.yml | 0 .../archive/ravello/delete_application.yml | 4 +- .../archive/ravello/save_environment.yml | 4 +- .../archive/ravello/ssh_env_keygen.yml | 10 +- .../ravello_infrastructure_deployment.yml | 22 +- .../archive/ravello_ssh_config_setup.yml | 20 +- .../archive/terraform_ec2_destroy_env.yml | 6 +- ...erraform_ec2_infrastructure_deployment.yml | 24 +-- .../terraform_ec2_ssh_config_setup.yml | 3 + .../terraform_infrastructure_deployment.yml | 8 +- .../RHCLS-ScalableInfra-demo/README.md | 0 .../configs}/RHCLS-ScalableInfra-demo/bastion | 0 .../RHCLS-ScalableInfra-demo/examples/README | 0 .../examples/ansible/library/ravello_app.py | 0 .../examples/ansible/test.yml | 0 .../examples/app-create | 0 .../examples/app-get-all | 0 .../examples/app-get-billing | 0 .../examples/app-get-data | 0 .../examples/app-get-id | 0 .../examples/app-get-state | 0 .../examples/app-get-vms | 0 .../examples/app-start | 0 .../examples/app-stop | 0 .../examples/app-update | 0 .../examples/bp-get-all | 0 .../examples/common.py | 0 .../examples/common.pyc | Bin .../examples/enforce_autostop.py | 0 .../examples/etoken-create | 0 .../examples/ravello.log | 0 .../examples/set-creds | 0 .../examples/startstop.py | 0 .../RHCLS-ScalableInfra-demo/examples/test.py | 0 .../RHCLS-ScalableInfra-demo/examples/vm-mgmt | 0 .../configs}/RHCLS-ScalableInfra-demo/exports | 0 .../playbooks/bastion-play.yml | 0 .../playbooks/inventory | 0 .../playbooks/roles/bastion/.travis.yml | 0 .../playbooks/roles/bastion/README.md | 0 .../playbooks/roles/bastion/defaults/main.yml | 0 .../playbooks/roles/bastion/handlers/main.yml | 0 .../playbooks/roles/bastion/meta/main.yml | 0 .../roles/bastion/tasks/iptables.yml | 0 .../playbooks/roles/bastion/tasks/main.yml | 0 .../roles/bastion/tasks/services.yml | 0 .../roles/bastion/templates/iptables.j2 | 0 .../roles/bastion/tests/bastion-play.yml | 0 .../playbooks/roles/bastion/tests/inventory | 0 .../playbooks/roles/bastion/tests/test.yml | 0 .../playbooks/roles/bastion/vars/main.yml | 0 .../playbooks/roles/osp/.travis.yml | 0 .../playbooks/roles/osp/README.md | 0 .../playbooks/roles/osp/defaults/main.yml | 0 .../playbooks/roles/osp/handlers/main.yml | 0 .../playbooks/roles/osp/meta/main.yml | 0 .../playbooks/roles/osp/tasks/main.yml | 0 .../playbooks/roles/osp/tests/inventory | 0 .../playbooks/roles/osp/tests/test.yml | 0 .../playbooks/roles/osp/vars/main.yml | 0 .../playbooks/roles/packages/.travis.yml | 0 .../playbooks/roles/packages/README.md | 0 .../roles/packages/defaults/main.yml | 0 .../roles/packages/handlers/main.yml | 0 .../playbooks/roles/packages/meta/main.yml | 0 .../roles/packages/tasks/bastion.yml | 0 .../playbooks/roles/packages/tasks/main.yml | 0 .../playbooks/roles/packages/tasks/osp.yml | 0 .../playbooks/roles/packages/tests/inventory | 0 .../playbooks/roles/packages/tests/test.yml | 0 .../playbooks/roles/packages/vars/main.yml | 0 .../playbooks/variables.yml | 0 .../RHCLS-ScalableInfra-demo/redhat.repo | 0 .../RHCLS-ScalableInfra-demo/software.yml | 0 .../configs}/ans-network-lab/README.adoc | 4 +- .../configs}/ans-network-lab/destroy_env.yml | 0 .../configs}/ans-network-lab/env_vars.yml | 2 +- .../cloud_providers/ec2_cloud_template.j2 | 0 .../ec2_cloud_template_json.j2 | 0 .../ans-network-lab/files/hosts_template.j2 | 0 .../ans-network-lab/files/repos_template.j2 | 0 .../configs}/ans-network-lab/post_infra.yml | 0 .../ans-network-lab/post_software.yml | 8 +- .../configs}/ans-network-lab/pre_infra.yml | 0 .../configs/ans-network-lab/pre_software.yml | 63 ++++++ .../configs}/ans-network-lab/software.yml | 0 .../How.To.Create.Env.Type.adoc | 0 .../ansible-tower-terraform/README.adoc | 4 +- .../ansible-tower-terraform/destroy_env.yml | 10 +- .../ansible-tower-terraform/env_vars.yml | 0 .../files/cloud_providers/aws.tf.j2 | 0 .../files/cloud_providers/terraform.tfvars.j2 | 0 .../ansible-tower-terraform/post_infra.yml | 4 +- .../ansible-tower-terraform/post_software.yml | 4 +- .../ansible-tower-terraform/pre_infra.yml | 0 .../ansible-tower-terraform/pre_software.yml | 33 +++ .../ansible-tower-terraform/software.yml | 0 .../configs}/auth-playground-lab/README.adoc | 2 +- .../auth-playground-lab/destroy_env.yml | 0 .../configs}/auth-playground-lab/env_vars.yml | 2 +- .../cloud_providers/ec2_cloud_template.j2 | 0 .../files/hosts_template.j2 | 0 .../files/opentlc-sample-config.sh.j2 | 0 .../files/repos_template.j2 | 0 .../auth-playground-lab/post_infra.yml | 0 .../auth-playground-lab/post_software.yml | 22 +- .../auth-playground-lab/pre_infra.yml | 6 +- .../auth-playground-lab/pre_software.yml | 79 ++++++++ .../configs}/auth-playground-lab/software.yml | 0 .../configs}/generic-example/README.adoc | 2 +- .../configs/generic-example/destroy_env.yml | 3 + .../configs}/generic-example/env_vars.yml | 2 +- .../cloud_providers/ec2_cloud_template.j2 | 0 .../generic-example/files/hosts_template.j2 | 0 .../generic-example/files/repos_template.j2 | 0 .../configs}/generic-example/post_infra.yml | 4 +- .../generic-example/post_software.yml | 10 +- .../configs}/generic-example/pre_infra.yml | 4 +- .../configs/generic-example/pre_software.yml | 63 ++++++ .../configs}/generic-example/software.yml | 0 .../configs}/ocp-adv-deploy-hw/README.adoc | 4 +- .../ocp-adv-deploy-hw/destroy_env.yml | 0 .../configs}/ocp-adv-deploy-hw/env_vars.yml | 0 .../cloud_providers/ec2_cloud_template.j2 | 0 .../files/ec2_internal_dns.json.j2 | 0 .../files/hosts_template.3.9.14.j2 | 0 .../files/hosts_template.3.9.25.j2 | 0 .../files/hosts_template.3.9.27.j2 | 0 .../files/htpasswd.openshift | 0 .../files/labs_hosts_template.j2 | 0 .../configs}/ocp-adv-deploy-hw/files/pvs.j2 | 0 .../ocp-adv-deploy-hw/files/repos_template.j2 | 0 .../ocp-adv-deploy-hw/files/userpvs.j2 | 0 .../configs}/ocp-adv-deploy-hw/post_infra.yml | 0 .../ocp-adv-deploy-hw/post_ocp_nfs_config.yml | 8 +- .../ocp-adv-deploy-hw/post_software.yml | 20 +- .../configs}/ocp-adv-deploy-hw/pre_infra.yml | 0 .../ocp-adv-deploy-hw/pre_software.yml | 74 +++++++ .../configs}/ocp-adv-deploy-hw/software.yml | 0 .../archive/configs}/ocp-demo-lab/README.adoc | 6 +- .../configs}/ocp-demo-lab/destroy_env.yml | 2 +- .../configs}/ocp-demo-lab/env_tests.yml | 0 .../configs}/ocp-demo-lab/env_vars.yml | 2 +- .../cloud_providers/ec2_cloud_template.j2 | 0 .../ocp-demo-lab/files/hosts_template.j2 | 0 .../ocp-demo-lab/files/htpasswd.openshift | 0 .../ocp-demo-lab/files/logrotate.d_syslog | 0 .../ocp-demo-lab/files/project-template.yml | 0 .../configs}/ocp-demo-lab/files/pvs.j2 | 0 .../ocp-demo-lab/files/repos_template.j2 | 0 .../configs}/ocp-demo-lab/files/userpvs.j2 | 0 .../configs}/ocp-demo-lab/post_infra.yml | 0 .../configs}/ocp-demo-lab/post_software.yml | 24 +-- .../configs}/ocp-demo-lab/pre_infra.yml | 0 .../configs}/ocp-demo-lab/pre_software.yml | 30 +-- .../configs}/ocp-demo-lab/software.yml | 0 .../How.To.Create.Env.Type.adoc | 0 .../ocp-implementation-lab-2/README.adoc | 0 .../ocp-implementation-lab-2/destroy_env.yml | 0 .../ocp-implementation-lab-2}/env_vars.yml | 2 +- .../cloud_providers/ec2_cloud_template.j2 | 0 .../files/ec2_internal_dns.json.j2 | 0 .../files/hosts_template.j2 | 0 .../files/htpasswd.openshift | 0 .../files/labs_hosts_template.j2 | 0 .../ocp-implementation-lab-2/files/pvs.j2 | 0 .../files/repos_template.j2 | 0 .../ocp-implementation-lab-2/files/userpvs.j2 | 0 .../ocp-implementation-lab-2/post_infra.yml | 0 .../post_software.yml | 10 +- .../ocp-implementation-lab-2/pre_infra.yml | 0 .../ocp-implementation-lab-2/pre_software.yml | 62 ++++++ .../ocp-implementation-lab-2/software.yml | 0 .../How.To.Create.Env.Type.adoc | 0 .../ocp-implementation-lab/README.adoc | 0 .../ocp-implementation-lab/destroy_env.yml | 0 .../ocp-implementation-lab}/env_vars.yml | 2 +- .../cloud_providers/ec2_cloud_template.j2 | 0 .../files/ec2_internal_dns.json.j2 | 0 .../files/hosts_template.j2 | 0 .../files/htpasswd.openshift | 0 .../files/labs_hosts_template.j2 | 0 .../ocp-implementation-lab/files/pvs.j2 | 0 .../files/repos_template.j2 | 0 .../ocp-implementation-lab/files/userpvs.j2 | 0 .../ocp-implementation-lab/post_infra.yml | 0 .../ocp-implementation-lab/post_software.yml | 8 +- .../ocp-implementation-lab/pre_infra.yml | 0 .../ocp-implementation-lab/pre_software.yml | 30 +-- .../ocp-implementation-lab/software.yml | 0 .../README.adoc | 10 +- .../destroy_env.yml | 2 +- .../env_tests.yml | 0 .../env_vars.yml | 0 .../cloud_providers/azure_cloud_template.j2 | 0 .../cloud_providers/ec2_cloud_template.j2 | 0 ...internal_dns.json.j2.not_required_any_more | 0 .../files/env_infra_template.j2 | 0 .../files/hosts_template.3.9.14.j2 | 0 .../files/hosts_template.3.9.25.j2 | 0 .../files/hosts_template.3.9.27.j2 | 0 .../files/hosts_template.3.9.30.j2 | 0 .../files/hosts_template.3.9.31.j2 | 0 .../files/hosts_template.j2 | 0 .../files/htpasswd.openshift | 0 .../lets-encrypt-x3-cross-signed.pem.txt | 0 .../files/logrotate.d_syslog | 0 .../files/ocp_report.adoc.j2 | 0 .../files/project-template.yml | 0 .../files/pvs.j2 | 0 .../files/repos_template.j2 | 0 .../files/userpvs.j2 | 0 .../mgr_users.yml | 0 .../post_infra.yml | 24 +-- .../post_software.yml | 104 +++++----- .../pre_infra.yml | 0 .../pre_software.yml | 46 ++--- .../scaleup.yml | 58 +++--- .../software.yml | 0 .../configs}/opentlc-shared/README.adoc | 0 .../configs}/opentlc-shared/destroy_env.yml | 2 +- .../configs}/opentlc-shared/env_tests.yml | 0 .../configs}/opentlc-shared/env_vars.yml | 0 .../cloud_providers/ec2_cloud_template.j2 | 0 .../files/ec2_internal_dns.json.j2 | 0 .../opentlc-shared/files/hosts_template.j2 | 0 .../opentlc-shared/files/htpasswd.openshift | 0 .../opentlc-shared/files/logrotate.d_syslog | 0 .../opentlc-shared/files/project-template.yml | 0 .../configs}/opentlc-shared/files/pvs.j2 | 0 .../opentlc-shared/files/repos_template.j2 | 0 .../configs}/opentlc-shared/files/userpvs.j2 | 0 .../configs}/opentlc-shared/post_infra.yml | 0 .../configs}/opentlc-shared/post_software.yml | 22 +- .../configs}/opentlc-shared/pre_infra.yml | 0 .../configs}/opentlc-shared/pre_software.yml | 6 +- .../configs}/opentlc-shared/ssh_vars.yml | 0 .../How.To.Create.Env.Type.adoc | 0 .../ravello-bastion-setup/README.adoc | 0 .../add_hosts_ssh_config.yml | 8 +- .../ravello-bastion-setup/destroy_env.yml | 4 +- .../ravello-bastion-setup/env_vars.yml | 2 +- .../cloud_providers/ec2_cloud_template.j2 | 0 .../cloud_providers/ravello_cloud_template.j2 | 0 .../ravello_cloud_template.j2.short | 0 .../ravello_cloud_template_2host.j2 | 0 .../files/ec2_internal_dns.json.j2 | 0 .../files/hosts_template.j2 | 0 .../files/opentlc-sample-config.sh.j2 | 0 .../ravello-bastion-setup/post_infra.yml | 0 .../ravello-bastion-setup/post_software.yml | 6 +- .../ravello-bastion-setup/pre_infra.yml | 2 +- .../ravello-bastion-setup/pre_software.yml | 16 +- .../ravello-bastion-setup/software.yml | 0 .../ravello-bastion-setup/ssh_vars.yml | 1 + .../ravello-test/How.To.Create.Env.Type.adoc | 0 .../archive/configs}/ravello-test/README.adoc | 0 .../configs}/ravello-test/destroy_env.yml | 4 +- .../configs}/ravello-test/env_vars.yml | 0 .../cloud_providers/ec2_cloud_template.j2 | 0 .../cloud_providers/ravello_cloud_template.j2 | 0 .../ravello_cloud_template.j2.short | 0 .../ravello_cloud_template_2host.j2 | 0 .../files/ec2_internal_dns.json.j2 | 0 .../ravello-test/files/hosts_template.j2 | 0 .../files/opentlc-sample-config.sh.j2 | 0 .../configs}/ravello-test/post_infra.yml | 0 .../configs}/ravello-test/post_software.yml | 6 +- .../configs}/ravello-test/pre_infra.yml | 0 .../configs}/ravello-test/pre_software.yml | 0 .../configs}/ravello-test/ssh_vars.yml | 0 .../single-ipa/How.To.Create.Env.Type.adoc | 0 .../archive/configs}/single-ipa/README.adoc | 2 +- .../configs}/single-ipa/destroy_env.yml | 4 +- .../archive/configs}/single-ipa/env_vars.yml | 2 +- .../cloud_providers/ec2_cloud_template.j2 | 0 .../single-ipa/files/ec2_internal_dns.json.j2 | 0 .../single-ipa/files/hosts_template.j2 | 0 .../files/opentlc-sample-config.sh.j2 | 0 .../configs}/single-ipa/post_infra.yml | 0 .../configs}/single-ipa/post_software.yml | 2 +- .../archive/configs}/single-ipa/pre_infra.yml | 0 .../configs}/single-ipa/pre_software.yml | 10 +- tools/archive/configs/single-ipa/ssh_vars.yml | 1 + 564 files changed, 2672 insertions(+), 2755 deletions(-) delete mode 100644 ansible/ansible.cfg delete mode 100644 ansible/cloud_providers/archive/terraform_ec2_ssh_config_setup.yml delete mode 100644 ansible/configs/archive/ans-network-lab/pre_software.yml delete mode 100644 ansible/configs/archive/ansible-tower-terraform/pre_software.yml delete mode 100644 ansible/configs/archive/auth-playground-lab/pre_software.yml delete mode 100644 ansible/configs/archive/generic-example/destroy_env.yml delete mode 100644 ansible/configs/archive/generic-example/pre_software.yml delete mode 100644 ansible/configs/archive/ocp-adv-deploy-hw/pre_software.yml delete mode 100644 ansible/configs/archive/ocp-implementation-lab-2/pre_software.yml delete mode 100644 ansible/configs/archive/ravello-bastion-setup/ssh_vars.yml delete mode 100644 ansible/configs/archive/single-ipa/ssh_vars.yml delete mode 100644 ansible/software_playbooks/archive/hello_motd.yml rename {ansible/cloud_providers => tools/archive/cloudproviders}/archive/launch-inventory-sync.yml (100%) rename {ansible/cloud_providers => tools/archive/cloudproviders}/archive/ravello/delete_application.yml (74%) rename {ansible/cloud_providers => tools/archive/cloudproviders}/archive/ravello/save_environment.yml (68%) rename {ansible/cloud_providers => tools/archive/cloudproviders}/archive/ravello/ssh_env_keygen.yml (60%) rename {ansible/cloud_providers => tools/archive/cloudproviders}/archive/ravello_infrastructure_deployment.yml (78%) rename {ansible/cloud_providers => tools/archive/cloudproviders}/archive/ravello_ssh_config_setup.yml (68%) rename {ansible/cloud_providers => tools/archive/cloudproviders}/archive/terraform_ec2_destroy_env.yml (73%) rename {ansible/cloud_providers => tools/archive/cloudproviders}/archive/terraform_ec2_infrastructure_deployment.yml (80%) create mode 100644 tools/archive/cloudproviders/archive/terraform_ec2_ssh_config_setup.yml rename {ansible/cloud_providers => tools/archive/cloudproviders}/archive/terraform_infrastructure_deployment.yml (76%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/README.md (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/bastion (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/README (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/ansible/library/ravello_app.py (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/ansible/test.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/app-create (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/app-get-all (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/app-get-billing (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/app-get-data (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/app-get-id (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/app-get-state (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/app-get-vms (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/app-start (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/app-stop (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/app-update (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/bp-get-all (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/common.py (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/common.pyc (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/enforce_autostop.py (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/etoken-create (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/ravello.log (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/set-creds (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/startstop.py (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/test.py (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/examples/vm-mgmt (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/exports (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/bastion-play.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/inventory (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/.travis.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/README.md (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/defaults/main.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/handlers/main.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/meta/main.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tasks/iptables.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tasks/main.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tasks/services.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/templates/iptables.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tests/bastion-play.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tests/inventory (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tests/test.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/vars/main.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/osp/.travis.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/osp/README.md (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/osp/defaults/main.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/osp/handlers/main.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/osp/meta/main.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/osp/tasks/main.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/osp/tests/inventory (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/osp/tests/test.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/osp/vars/main.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/packages/.travis.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/packages/README.md (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/packages/defaults/main.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/packages/handlers/main.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/packages/meta/main.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tasks/bastion.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tasks/main.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tasks/osp.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tests/inventory (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tests/test.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/roles/packages/vars/main.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/playbooks/variables.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/redhat.repo (100%) rename {ansible/configs/archive => tools/archive/configs}/RHCLS-ScalableInfra-demo/software.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ans-network-lab/README.adoc (95%) rename {ansible/configs/archive => tools/archive/configs}/ans-network-lab/destroy_env.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ans-network-lab/env_vars.yml (98%) rename {ansible/configs/archive => tools/archive/configs}/ans-network-lab/files/cloud_providers/ec2_cloud_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ans-network-lab/files/cloud_providers/ec2_cloud_template_json.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ans-network-lab/files/hosts_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ans-network-lab/files/repos_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ans-network-lab/post_infra.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ans-network-lab/post_software.yml (67%) rename {ansible/configs/archive => tools/archive/configs}/ans-network-lab/pre_infra.yml (100%) create mode 100644 tools/archive/configs/ans-network-lab/pre_software.yml rename {ansible/configs/archive => tools/archive/configs}/ans-network-lab/software.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ansible-tower-terraform/How.To.Create.Env.Type.adoc (100%) rename {ansible/configs/archive => tools/archive/configs}/ansible-tower-terraform/README.adoc (93%) rename {ansible/configs/archive => tools/archive/configs}/ansible-tower-terraform/destroy_env.yml (68%) rename {ansible/configs/archive => tools/archive/configs}/ansible-tower-terraform/env_vars.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ansible-tower-terraform/files/cloud_providers/aws.tf.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ansible-tower-terraform/files/cloud_providers/terraform.tfvars.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ansible-tower-terraform/post_infra.yml (74%) rename {ansible/configs/archive => tools/archive/configs}/ansible-tower-terraform/post_software.yml (74%) rename {ansible/configs/archive => tools/archive/configs}/ansible-tower-terraform/pre_infra.yml (100%) create mode 100644 tools/archive/configs/ansible-tower-terraform/pre_software.yml rename {ansible/configs/archive => tools/archive/configs}/ansible-tower-terraform/software.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/auth-playground-lab/README.adoc (97%) rename {ansible/configs/archive => tools/archive/configs}/auth-playground-lab/destroy_env.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/auth-playground-lab/env_vars.yml (98%) rename {ansible/configs/archive => tools/archive/configs}/auth-playground-lab/files/cloud_providers/ec2_cloud_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/auth-playground-lab/files/hosts_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/auth-playground-lab/files/opentlc-sample-config.sh.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/auth-playground-lab/files/repos_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/auth-playground-lab/post_infra.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/auth-playground-lab/post_software.yml (59%) rename {ansible/configs/archive => tools/archive/configs}/auth-playground-lab/pre_infra.yml (82%) create mode 100644 tools/archive/configs/auth-playground-lab/pre_software.yml rename {ansible/configs/archive => tools/archive/configs}/auth-playground-lab/software.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/generic-example/README.adoc (97%) create mode 100644 tools/archive/configs/generic-example/destroy_env.yml rename {ansible/configs/archive => tools/archive/configs}/generic-example/env_vars.yml (98%) rename {ansible/configs/archive => tools/archive/configs}/generic-example/files/cloud_providers/ec2_cloud_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/generic-example/files/hosts_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/generic-example/files/repos_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/generic-example/post_infra.yml (81%) rename {ansible/configs/archive => tools/archive/configs}/generic-example/post_software.yml (60%) rename {ansible/configs/archive => tools/archive/configs}/generic-example/pre_infra.yml (57%) create mode 100644 tools/archive/configs/generic-example/pre_software.yml rename {ansible/configs/archive => tools/archive/configs}/generic-example/software.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/README.adoc (96%) rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/destroy_env.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/env_vars.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/files/cloud_providers/ec2_cloud_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/files/ec2_internal_dns.json.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/files/hosts_template.3.9.14.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/files/hosts_template.3.9.25.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/files/hosts_template.3.9.27.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/files/htpasswd.openshift (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/files/labs_hosts_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/files/pvs.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/files/repos_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/files/userpvs.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/post_infra.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/post_ocp_nfs_config.yml (80%) rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/post_software.yml (76%) rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/pre_infra.yml (100%) create mode 100644 tools/archive/configs/ocp-adv-deploy-hw/pre_software.yml rename {ansible/configs/archive => tools/archive/configs}/ocp-adv-deploy-hw/software.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-demo-lab/README.adoc (94%) rename {ansible/configs/archive => tools/archive/configs}/ocp-demo-lab/destroy_env.yml (95%) rename {ansible/configs/archive => tools/archive/configs}/ocp-demo-lab/env_tests.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-demo-lab/env_vars.yml (98%) rename {ansible/configs/archive => tools/archive/configs}/ocp-demo-lab/files/cloud_providers/ec2_cloud_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-demo-lab/files/hosts_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-demo-lab/files/htpasswd.openshift (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-demo-lab/files/logrotate.d_syslog (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-demo-lab/files/project-template.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-demo-lab/files/pvs.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-demo-lab/files/repos_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-demo-lab/files/userpvs.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-demo-lab/post_infra.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-demo-lab/post_software.yml (80%) rename {ansible/configs/archive => tools/archive/configs}/ocp-demo-lab/pre_infra.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-demo-lab/pre_software.yml (60%) rename {ansible/configs/archive => tools/archive/configs}/ocp-demo-lab/software.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab-2/How.To.Create.Env.Type.adoc (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab-2/README.adoc (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab-2/destroy_env.yml (100%) rename {ansible/configs/archive/ocp-implementation-lab => tools/archive/configs/ocp-implementation-lab-2}/env_vars.yml (98%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab-2/files/cloud_providers/ec2_cloud_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab-2/files/ec2_internal_dns.json.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab-2/files/hosts_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab-2/files/htpasswd.openshift (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab-2/files/labs_hosts_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab-2/files/pvs.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab-2/files/repos_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab-2/files/userpvs.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab-2/post_infra.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab-2/post_software.yml (64%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab-2/pre_infra.yml (100%) create mode 100644 tools/archive/configs/ocp-implementation-lab-2/pre_software.yml rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab-2/software.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab/How.To.Create.Env.Type.adoc (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab/README.adoc (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab/destroy_env.yml (100%) rename {ansible/configs/archive/ocp-implementation-lab-2 => tools/archive/configs/ocp-implementation-lab}/env_vars.yml (98%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab/files/cloud_providers/ec2_cloud_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab/files/ec2_internal_dns.json.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab/files/hosts_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab/files/htpasswd.openshift (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab/files/labs_hosts_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab/files/pvs.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab/files/repos_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab/files/userpvs.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab/post_infra.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab/post_software.yml (72%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab/pre_infra.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab/pre_software.yml (60%) rename {ansible/configs/archive => tools/archive/configs}/ocp-implementation-lab/software.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/README.adoc (94%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/destroy_env.yml (95%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/env_tests.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/env_vars.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/cloud_providers/azure_cloud_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/cloud_providers/ec2_cloud_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/ec2_internal_dns.json.j2.not_required_any_more (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/env_infra_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.14.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.25.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.27.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.30.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.31.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/htpasswd.openshift (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/lets-encrypt-x3-cross-signed.pem.txt (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/logrotate.d_syslog (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/ocp_report.adoc.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/project-template.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/pvs.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/repos_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/files/userpvs.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/mgr_users.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/post_infra.yml (92%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/post_software.yml (79%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/pre_infra.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/pre_software.yml (63%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/scaleup.yml (68%) rename {ansible/configs/archive => tools/archive/configs}/ocp-storage-cns_based_on_ocp-workshop/software.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/README.adoc (100%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/destroy_env.yml (95%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/env_tests.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/env_vars.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/files/cloud_providers/ec2_cloud_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/files/ec2_internal_dns.json.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/files/hosts_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/files/htpasswd.openshift (100%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/files/logrotate.d_syslog (100%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/files/project-template.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/files/pvs.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/files/repos_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/files/userpvs.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/post_infra.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/post_software.yml (90%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/pre_infra.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/pre_software.yml (84%) rename {ansible/configs/archive => tools/archive/configs}/opentlc-shared/ssh_vars.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-bastion-setup/How.To.Create.Env.Type.adoc (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-bastion-setup/README.adoc (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-bastion-setup/add_hosts_ssh_config.yml (69%) rename {ansible/configs/archive => tools/archive/configs}/ravello-bastion-setup/destroy_env.yml (88%) rename {ansible/configs/archive => tools/archive/configs}/ravello-bastion-setup/env_vars.yml (97%) rename {ansible/configs/archive => tools/archive/configs}/ravello-bastion-setup/files/cloud_providers/ec2_cloud_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-bastion-setup/files/cloud_providers/ravello_cloud_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-bastion-setup/files/cloud_providers/ravello_cloud_template.j2.short (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-bastion-setup/files/cloud_providers/ravello_cloud_template_2host.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-bastion-setup/files/ec2_internal_dns.json.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-bastion-setup/files/hosts_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-bastion-setup/files/opentlc-sample-config.sh.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-bastion-setup/post_infra.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-bastion-setup/post_software.yml (85%) rename {ansible/configs/archive => tools/archive/configs}/ravello-bastion-setup/pre_infra.yml (81%) rename {ansible/configs/archive => tools/archive/configs}/ravello-bastion-setup/pre_software.yml (66%) rename {ansible/configs/archive => tools/archive/configs}/ravello-bastion-setup/software.yml (100%) create mode 100644 tools/archive/configs/ravello-bastion-setup/ssh_vars.yml rename {ansible/configs/archive => tools/archive/configs}/ravello-test/How.To.Create.Env.Type.adoc (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-test/README.adoc (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-test/destroy_env.yml (87%) rename {ansible/configs/archive => tools/archive/configs}/ravello-test/env_vars.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-test/files/cloud_providers/ec2_cloud_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-test/files/cloud_providers/ravello_cloud_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-test/files/cloud_providers/ravello_cloud_template.j2.short (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-test/files/cloud_providers/ravello_cloud_template_2host.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-test/files/ec2_internal_dns.json.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-test/files/hosts_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-test/files/opentlc-sample-config.sh.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-test/post_infra.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-test/post_software.yml (82%) rename {ansible/configs/archive => tools/archive/configs}/ravello-test/pre_infra.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-test/pre_software.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/ravello-test/ssh_vars.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/single-ipa/How.To.Create.Env.Type.adoc (100%) rename {ansible/configs/archive => tools/archive/configs}/single-ipa/README.adoc (96%) rename {ansible/configs/archive => tools/archive/configs}/single-ipa/destroy_env.yml (89%) rename {ansible/configs/archive => tools/archive/configs}/single-ipa/env_vars.yml (97%) rename {ansible/configs/archive => tools/archive/configs}/single-ipa/files/cloud_providers/ec2_cloud_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/single-ipa/files/ec2_internal_dns.json.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/single-ipa/files/hosts_template.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/single-ipa/files/opentlc-sample-config.sh.j2 (100%) rename {ansible/configs/archive => tools/archive/configs}/single-ipa/post_infra.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/single-ipa/post_software.yml (94%) rename {ansible/configs/archive => tools/archive/configs}/single-ipa/pre_infra.yml (100%) rename {ansible/configs/archive => tools/archive/configs}/single-ipa/pre_software.yml (80%) create mode 100644 tools/archive/configs/single-ipa/ssh_vars.yml diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg deleted file mode 100644 index f6b36f4dbf5..00000000000 --- a/ansible/ansible.cfg +++ /dev/null @@ -1,9 +0,0 @@ -[defaults] -forks= 50 -nocows=1 -# provide stats -callback_whitelist = profile_tasks -# Use the YAML callback plugin. -stdout_callback = yaml -# Use the stdout_callback when running ad-hoc commands. -bin_ansible_callbacks = True \ No newline at end of file diff --git a/ansible/cloud_providers/archive/terraform_ec2_ssh_config_setup.yml b/ansible/cloud_providers/archive/terraform_ec2_ssh_config_setup.yml deleted file mode 100644 index c0bd6da78a4..00000000000 --- a/ansible/cloud_providers/archive/terraform_ec2_ssh_config_setup.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- name: Configure local ssh config for bastion proxy use - import_playbook: "{{ANSIBLE_REPO_PATH}}/cloud_providers/common_ssh_config_setup.yml" diff --git a/ansible/cloud_providers/azure_destroy_env.yml b/ansible/cloud_providers/azure_destroy_env.yml index a4a0df4dfa0..fbfa33f4dd3 100644 --- a/ansible/cloud_providers/azure_destroy_env.yml +++ b/ansible/cloud_providers/azure_destroy_env.yml @@ -64,7 +64,7 @@ AZURE_CONFIG_DIR: "/tmp/.azure-{{project_tag}}" block: - set_fact: - t_dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.{{cloud_provider}}_cloud_template" + t_dest: "{{workdir_dir}}/{ env_type }}.{{ guid }}.{{cloud_provider}}_cloud_template" - name: Get all resources from the deployment command: az group deployment show --name {{env_type}}.{{guid}} --resource-group {{az_resource_group}} diff --git a/ansible/cloud_providers/azure_infrastructure_deployment.yml b/ansible/cloud_providers/azure_infrastructure_deployment.yml index 2f89afea233..03d80916db8 100644 --- a/ansible/cloud_providers/azure_infrastructure_deployment.yml +++ b/ansible/cloud_providers/azure_infrastructure_deployment.yml @@ -33,8 +33,8 @@ - must - set_fact: - t_dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.{{cloud_provider}}_cloud_template" - params_dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{project_tag}}-cloud_template_parameters.json" + t_dest: "{{workdir_dir}}/{{ env_type }}.{{ guid }}.{{cloud_provider}}_cloud_template" + params_dest: "{{workdir_dir}}/{{project_tag}}-cloud_template_parameters.json" tags: - azure_infrastructure_deployment - validate_azure_template @@ -42,7 +42,7 @@ - name: Azure Generate Resource manager template template: - src: "{{ANSIBLE_REPO_PATH}}/configs/{{ env_type }}/files/cloud_providers/{{cloud_provider}}_cloud_template.j2" + src: "{{ANSIBLE_REPO_PATH | default('.')}}/configs/{{ env_type }}/files/cloud_providers/{{cloud_provider}}_cloud_template.j2" dest: "{{t_dest}}" tags: - azure_infrastructure_deployment @@ -256,7 +256,7 @@ verbosity: 2 - name: Configure local ssh config for bastion proxy use - import_playbook: "{{ANSIBLE_REPO_PATH}}/cloud_providers/{{cloud_provider}}_ssh_config_setup.yml" + import_playbook: "{{ANSIBLE_REPO_PATH | default('.')}}/cloud_providers/{{cloud_provider}}_ssh_config_setup.yml" when: groups['bastions'] tags: - must @@ -392,7 +392,7 @@ block: - name: Map Azure disks using LUN. include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-azure-disk-map" + name: "infra-azure-disk-map" vars: disk_map_device: name: "{{ item.name }}" diff --git a/ansible/cloud_providers/azure_ssh_config_setup.yml b/ansible/cloud_providers/azure_ssh_config_setup.yml index c0bd6da78a4..289ab9da8fe 100644 --- a/ansible/cloud_providers/azure_ssh_config_setup.yml +++ b/ansible/cloud_providers/azure_ssh_config_setup.yml @@ -1,3 +1,3 @@ --- - name: Configure local ssh config for bastion proxy use - import_playbook: "{{ANSIBLE_REPO_PATH}}/cloud_providers/common_ssh_config_setup.yml" + import_playbook: "{{ANSIBLE_REPO_PATH | default('.')}}/cloud_providers/common_ssh_config_setup.yml" diff --git a/ansible/cloud_providers/common_ssh_config_setup.yml b/ansible/cloud_providers/common_ssh_config_setup.yml index 585cccb92f5..92270e36903 100644 --- a/ansible/cloud_providers/common_ssh_config_setup.yml +++ b/ansible/cloud_providers/common_ssh_config_setup.yml @@ -19,8 +19,8 @@ bastion_hostname: "{{groups['bastions'].0 }}" # This is where the ssh_config file will be created, this file is used to # define the communication method to all the hosts in the deployment - ansible_ssh_config: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" - ansible_known_host: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_known_hosts" + ansible_ssh_config: "{{workdir_dir}}/{{ env_type }}_{{ guid }}_ssh_conf" + ansible_known_host: "{{workdir_dir}}/{{ env_type }}_{{ guid }}_ssh_known_hosts" - name: Delete dedicated known_host if it exists (new deployment) file: diff --git a/ansible/cloud_providers/ec2_infrastructure_deployment.yml b/ansible/cloud_providers/ec2_infrastructure_deployment.yml index 6e612d2f6c6..67e0bb31fb3 100644 --- a/ansible/cloud_providers/ec2_infrastructure_deployment.yml +++ b/ansible/cloud_providers/ec2_infrastructure_deployment.yml @@ -13,17 +13,17 @@ tasks: - name: Run infra-ec2-template-generate Role import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-ec2-template-generate" + name: infra-ec2-template-generate - name: Run infra-ec2-template-create Role import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-ec2-template-create" + name: "infra-ec2-template-create" vars: aws_region_loop: "{{aws_region}}" - name: Run infra-ec2-template-create Role into FallBack region include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-ec2-template-create" + name: "infra-ec2-template-create" vars: aws_region_loop: "{{item}}" with_items: "{{ fallback_regions }}" @@ -56,10 +56,10 @@ - name: Run infra-ec2-create-inventory Role import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-ec2-create-inventory" + name: "infra-ec2-create-inventory" - name: Run Common SSH Config Generator Role import_role: - name: "{{ANSIBLE_REPO_PATH}}/roles/infra-common-ssh-config-generate" + name: "infra-common-ssh-config-generate" # include global vars again, this time for all hosts now that the inventory is built - import_playbook: ../include_vars.yml @@ -82,14 +82,14 @@ - create_inventory set_fact: aws_region_final: "{{hostvars['localhost'].aws_region_final}}" - ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" + ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{workdir_dir}}/{{ env_type }}_{{ guid }}_ssh_conf" - name: Run infra-ec2-wait_for_linux_hosts Role import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-ec2-wait_for_linux_hosts" + name: "infra-ec2-wait_for_linux_hosts" - name: Run infra-ec2-linux-set-hostname Role import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-ec2-linux-set-hostname" + name: "infra-ec2-linux-set-hostname" @@ -117,4 +117,4 @@ - name: Run infra-ec2-wait_for_linux_hosts Role import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-ec2-wait_for_windows_hosts" + name: "infra-ec2-wait_for_windows_hosts" diff --git a/ansible/cloud_providers/ec2_ssh_config_setup.yml b/ansible/cloud_providers/ec2_ssh_config_setup.yml index c0bd6da78a4..08fb4b41c98 100644 --- a/ansible/cloud_providers/ec2_ssh_config_setup.yml +++ b/ansible/cloud_providers/ec2_ssh_config_setup.yml @@ -1,3 +1,3 @@ --- - name: Configure local ssh config for bastion proxy use - import_playbook: "{{ANSIBLE_REPO_PATH}}/cloud_providers/common_ssh_config_setup.yml" + import_playbook: "./cloud_providers/common_ssh_config_setup.yml" diff --git a/ansible/configs/ans-tower-lab/README.adoc b/ansible/configs/ans-tower-lab/README.adoc index 77c30c247b3..e465437d502 100644 --- a/ansible/configs/ans-tower-lab/README.adoc +++ b/ansible/configs/ans-tower-lab/README.adoc @@ -60,7 +60,7 @@ DEPLOYER_REPO_PATH=`pwd` ansible-playbook \ ${DEPLOYER_REPO_PATH}/main.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" \ -e "env_type=${ENVTYPE}" \ -e "key_name=${KEYNAME}" \ @@ -91,7 +91,7 @@ DEPLOYER_REPO_PATH=`pwd` ansible-playbook \ ${DEPLOYER_REPO_PATH}/main.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" \ -e "env_type=${ENVTYPE}" \ -e "key_name=${KEYNAME}" \ diff --git a/ansible/configs/ans-tower-lab/destroy_env.yml b/ansible/configs/ans-tower-lab/destroy_env.yml index 09c4475668a..df6859ecc2a 100644 --- a/ansible/configs/ans-tower-lab/destroy_env.yml +++ b/ansible/configs/ans-tower-lab/destroy_env.yml @@ -3,9 +3,9 @@ connection: local gather_facts: False become: no - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tasks: - name: Destroy cloudformation template diff --git a/ansible/configs/ans-tower-lab/post_infra.yml b/ansible/configs/ans-tower-lab/post_infra.yml index cb74cb0897c..932f5bb62d5 100644 --- a/ansible/configs/ans-tower-lab/post_infra.yml +++ b/ansible/configs/ans-tower-lab/post_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure diff --git a/ansible/configs/ans-tower-lab/post_software.yml b/ansible/configs/ans-tower-lab/post_software.yml index 21d6fac6eaf..506aa74fae9 100644 --- a/ansible/configs/ans-tower-lab/post_software.yml +++ b/ansible/configs/ans-tower-lab/post_software.yml @@ -2,8 +2,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - debug: msg: "Post-Software tasks Started" @@ -12,15 +12,15 @@ hosts: - windows[0] gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks - windows_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/windows-ad", when: install_win_ad | bool } + - { role: "windows-ad", when: install_win_ad | bool } tasks: - name: Reboot upon promotion win_reboot: @@ -36,14 +36,14 @@ become: yes tags: - opentlc_bastion_tasks - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/ansible-version-lock" + name: "ansible-version-lock" - name: Copy Tower License File copy: @@ -68,28 +68,28 @@ - name: Post Tower configs hosts: towers[0] become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/tower_demo", when: deploy_tower_demo | d(false) | bool } + - { role: "tower_demo", when: deploy_tower_demo | d(false) | bool } - name: Install Tower For Homework hosts: bastions become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/install-tower", when: deploy_tower_homework | d(false) | bool } + - { role: "install-tower", when: deploy_tower_homework | d(false) | bool } - name: PostSoftware flight-check hosts: localhost connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/ans-tower-lab/pre_infra.yml b/ansible/configs/ans-tower-lab/pre_infra.yml index 1c729639fdd..71657f9385e 100644 --- a/ansible/configs/ans-tower-lab/pre_infra.yml +++ b/ansible/configs/ans-tower-lab/pre_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -14,7 +14,7 @@ block: - name: Stat workdir/[...]_windows_password.txt file stat: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{guid}}_windows_password.txt" + path: "{{workdir_dir}}/{{ env_type }}_{{guid}}_windows_password.txt" register: passwordfile # This task needs to be "ansibled", we cannot assume tr exists # This also doesn't work on MAC, that does have tr. @@ -24,7 +24,7 @@ when: not passwordfile.stat.exists - name: Read windows password from workdir/[...]_windows_password.txt file - command: "cat '{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{guid}}_windows_password.txt'" + command: "cat '{{workdir_dir}}/{{ env_type }}_{{guid}}_windows_password.txt'" register: password_get_r changed_when: false when: passwordfile.stat.exists @@ -43,5 +43,5 @@ - name: Save windows_password or generated_windows_password into workdir/ copy: content: "{{ windows_password | default(generated_windows_password) }}" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{guid}}_windows_password.txt" + dest: "{{workdir_dir}}/{{ env_type }}_{{guid}}_windows_password.txt" mode: 0600 diff --git a/ansible/configs/ans-tower-lab/pre_software.yml b/ansible/configs/ans-tower-lab/pre_software.yml index 7f9a141a8fa..ec0b58b2f72 100644 --- a/ansible/configs/ans-tower-lab/pre_software.yml +++ b/ansible/configs/ans-tower-lab/pre_software.yml @@ -4,17 +4,17 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step003 - generate_env_keys tasks: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{workdir_dir}}/{{env_authorized_key}}" when: set_env_authorized_key # Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} @@ -24,26 +24,26 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/ansible-version-lock" } + - { role: "bastion", when: 'install_bastion' } + - { role: "ansible-version-lock" } tags: - step004 - bastion_tasks @@ -51,9 +51,9 @@ - name: Place Tower License from env_secret_vars on bastion hosts: bastions become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step003 - place_tower_license_file @@ -69,15 +69,15 @@ hosts: - windows gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks - windows_tasks roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/windows-common" + - role: "windows-common" when: install_win_ssh @@ -86,9 +86,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/ansible-cicd-lab/README.adoc b/ansible/configs/ansible-cicd-lab/README.adoc index 90c574aeb15..4ce0d6e0776 100644 --- a/ansible/configs/ansible-cicd-lab/README.adoc +++ b/ansible/configs/ansible-cicd-lab/README.adoc @@ -75,14 +75,14 @@ ENVTYPE="ansible-cicd-lab" CLOUDPROVIDER=ec2 HOSTZONEID='Z3IHLWJZOU9SRT' REPO_PATH='http://admin.example.com/repos/ocp/3.9.33/' -ANSIBLE_REPO_PATH=`pwd` +ANSIBLE_REPO_PATH | default('.')=`pwd` BASESUFFIX='.example.opentlc.com' DEPLOYER_REPO_PATH=`pwd` ADMIN_PASSWORD=somepassword LICENSE_URL="https://admin.example.com/download/ansible_bootcamp/tower/licenses/license.txt" ansible-playbook \ ${DEPLOYER_REPO_PATH}/main.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" \ -e "env_type=${ENVTYPE}" \ -e "key_name=${KEYNAME}" \ @@ -114,7 +114,7 @@ DEPLOYER_REPO_PATH=`pwd` ansible-playbook \ ${DEPLOYER_REPO_PATH}/main.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" \ -e "env_type=${ENVTYPE}" \ -e "key_name=${KEYNAME}" \ @@ -142,7 +142,7 @@ HOSTZONEID='Z3IHLWJZOU9SRT' BASESUFFIX='.example.opentlc.com' #To Destroy an Env ansible-playbook ./configs/${ENVTYPE}/destroy_env.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" -e "env_type=${ENVTYPE}" -e "cloud_provider=${CLOUDPROVIDER}" -e "aws_region=${REGION}" \ -e "HostedZoneId=${HOSTZONEID}" -e "key_name=${KEYNAME}" -e "subdomain_base_suffix=${BASESUFFIX}" ---- diff --git a/ansible/configs/ansible-cicd-lab/destroy_env.yml b/ansible/configs/ansible-cicd-lab/destroy_env.yml index b4c7ba07743..86429d20705 100644 --- a/ansible/configs/ansible-cicd-lab/destroy_env.yml +++ b/ansible/configs/ansible-cicd-lab/destroy_env.yml @@ -3,17 +3,17 @@ connection: local gather_facts: False become: no - vars_files: - - "{{ANSIBLE_REPO_PATH}}/configs/{{ env_type }}/env_vars.yml" - - "{{ANSIBLE_REPO_PATH}}/configs/{{ env_type }}/env_secret_vars.yml" + + + tasks: - name: Run infra-ec2-template-destroy include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-{{cloud_provider}}-template-destroy" + name: "infra-{{cloud_provider}}-template-destroy" when: cloud_provider == 'ec2' - name: Run infra-azure-template-destroy include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-{{cloud_provider}}-template-destroy" + name: "infra-{{cloud_provider}}-template-destroy" when: cloud_provider == 'azure' diff --git a/ansible/configs/ansible-cicd-lab/env_vars.yml b/ansible/configs/ansible-cicd-lab/env_vars.yml index de872601465..53e9a1c23a9 100644 --- a/ansible/configs/ansible-cicd-lab/env_vars.yml +++ b/ansible/configs/ansible-cicd-lab/env_vars.yml @@ -35,7 +35,7 @@ project_tag: "{{ env_type }}-{{ guid }}" # This is where the ssh_config file will be created, this file is used to # define the communication method to all the hosts in the deployment -deploy_local_ssh_config_location: "{{ANSIBLE_REPO_PATH}}/workdir" +deploy_local_ssh_config_location: "{{workdir_dir}}/" install_bastion: true install_common: true diff --git a/ansible/configs/ansible-cicd-lab/post_infra.yml b/ansible/configs/ansible-cicd-lab/post_infra.yml index cb74cb0897c..5036e4f0333 100644 --- a/ansible/configs/ansible-cicd-lab/post_infra.yml +++ b/ansible/configs/ansible-cicd-lab/post_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure diff --git a/ansible/configs/ansible-cicd-lab/post_software.yml b/ansible/configs/ansible-cicd-lab/post_software.yml index 7c46b8abdb5..3328ef40c58 100644 --- a/ansible/configs/ansible-cicd-lab/post_software.yml +++ b/ansible/configs/ansible-cicd-lab/post_software.yml @@ -2,8 +2,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - debug: msg: "Post-Software tasks Started" @@ -13,9 +13,9 @@ - cicd* become: true gather_facts: True - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - install_ci_components pre_tasks: @@ -31,10 +31,10 @@ keystore_pass: "{{ jenkins_keystore_password }}" roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/geerlingguy.gogs" } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/host-gogs-server" } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/host-jenkins-server" } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/molecule" } + - { role: "geerlingguy.gogs" } + - { role: "host-gogs-server" } + - { role: "host-jenkins-server" } + - { role: "molecule" } tasks: - name: include docker_setup tasks @@ -47,9 +47,9 @@ - hosts: bastions become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - configure_tower tasks: @@ -62,9 +62,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/ansible-cicd-lab/pre_infra.yml b/ansible/configs/ansible-cicd-lab/pre_infra.yml index 90178ba789a..48c59733999 100644 --- a/ansible/configs/ansible-cicd-lab/pre_infra.yml +++ b/ansible/configs/ansible-cicd-lab/pre_infra.yml @@ -3,9 +3,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -15,19 +15,19 @@ msg: "Step 000 Pre Infrastructure" - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{workdir_dir}}/{{env_authorized_key}}" when: set_env_authorized_key - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + path: "{{workdir_dir}}/{{env_authorized_key}}" mode: 0400 when: set_env_authorized_key - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{env_authorized_key}}" > "{{workdir_dir}}/{{env_authorized_key}}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + creates: "{{workdir_dir}}/{{env_authorized_key}}.pub" when: set_env_authorized_key diff --git a/ansible/configs/ansible-cicd-lab/pre_software.yml b/ansible/configs/ansible-cicd-lab/pre_software.yml index e8f1ada71a0..2f36e276f0c 100644 --- a/ansible/configs/ansible-cicd-lab/pre_software.yml +++ b/ansible/configs/ansible-cicd-lab/pre_software.yml @@ -5,27 +5,27 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa", when: 'install_ipa_client' } - - role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-student-user" + - { role: "bastion", when: 'install_bastion' } + - { role: "bastion-opentlc-ipa", when: 'install_ipa_client' } + - role: "bastion-student-user" when: install_student_user | bool tags: - step004 @@ -36,9 +36,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/ansible-provisioner/README.adoc b/ansible/configs/ansible-provisioner/README.adoc index 29d410d822f..5224c412da4 100644 --- a/ansible/configs/ansible-provisioner/README.adoc +++ b/ansible/configs/ansible-provisioner/README.adoc @@ -49,7 +49,7 @@ github_token: "" ---- -For managing users on the ansible provisioner, you can override the `mgr_users` variable. The default is located in `{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/mgr_users.yml`, and looks like : +For managing users on the ansible provisioner, you can override the `mgr_users` variable. The default is located in `{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/mgr_users.yml`, and looks like : .Default mgr_users.yml [source,yaml] diff --git a/ansible/configs/ansible-provisioner/destroy_env.yml b/ansible/configs/ansible-provisioner/destroy_env.yml index 753e6c2a905..e2116da7d3f 100644 --- a/ansible/configs/ansible-provisioner/destroy_env.yml +++ b/ansible/configs/ansible-provisioner/destroy_env.yml @@ -1,3 +1,3 @@ --- - name: Import default CloudFormation (aws) destroy playbook - import_playbook: "{{ANSIBLE_REPO_PATH}}/cloud_providers/{{cloud_provider}}_destroy_env.yml" + import_playbook: "{{workdir_dir}}/cloud_providers/{{cloud_provider}}_destroy_env.yml" diff --git a/ansible/configs/ansible-provisioner/post_infra.yml b/ansible/configs/ansible-provisioner/post_infra.yml index cb74cb0897c..932f5bb62d5 100644 --- a/ansible/configs/ansible-provisioner/post_infra.yml +++ b/ansible/configs/ansible-provisioner/post_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure diff --git a/ansible/configs/ansible-provisioner/post_software.yml b/ansible/configs/ansible-provisioner/post_software.yml index ce23d8ac8c3..4c23fb4c58d 100644 --- a/ansible/configs/ansible-provisioner/post_software.yml +++ b/ansible/configs/ansible-provisioner/post_software.yml @@ -4,9 +4,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step005 tasks: @@ -17,22 +17,22 @@ hosts: provisioners become: yes gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/mgr_users.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/mgr_users.yml" + + tags: [ env-specific, cf_integration ] tasks: - name: Configure IPA import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool vars: bastion_public_dns_chomped: "{{ inventory_hostname }}" - name: Import opentlc-integration role import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/opentlc-integration" + name: "opentlc-integration" when: install_opentlc_integration|bool vars: install_opentlc_smtp: true @@ -120,12 +120,12 @@ - name: Copy boto.cfg file to /etc copy: - src: "{{ ANSIBLE_REPO_PATH }}/inventory/boto.cfg" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/inventory/boto.cfg" dest: /etc/boto.cfg - name: Copy Sync_Repositories.sh file to /root copy: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/Sync_Repositories.sh" + src: "./files/Sync_Repositories.sh" dest: /root/ - name: install lvm2 @@ -234,11 +234,11 @@ hosts: provisioners gather_facts: true become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client" } + - { role: "zabbix-client" } tags: - env-specific - install_zabbix diff --git a/ansible/configs/ansible-provisioner/pre_infra.yml b/ansible/configs/ansible-provisioner/pre_infra.yml index 444cc902a90..91114c29c94 100644 --- a/ansible/configs/ansible-provisioner/pre_infra.yml +++ b/ansible/configs/ansible-provisioner/pre_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure diff --git a/ansible/configs/ansible-provisioner/pre_software.yml b/ansible/configs/ansible-provisioner/pre_software.yml index 421647b93ca..38f5aab78b5 100644 --- a/ansible/configs/ansible-provisioner/pre_software.yml +++ b/ansible/configs/ansible-provisioner/pre_software.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: False - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step003 - pre_software diff --git a/ansible/configs/archive/ans-network-lab/pre_software.yml b/ansible/configs/archive/ans-network-lab/pre_software.yml deleted file mode 100644 index 184f09bc4ed..00000000000 --- a/ansible/configs/archive/ans-network-lab/pre_software.yml +++ /dev/null @@ -1,63 +0,0 @@ - -- name: Step 003 - Create env key - hosts: localhost - connection: local - gather_facts: false - become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tags: - - step003 - - generate_env_keys - tasks: - - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" - args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" - when: set_env_authorized_key - -# Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} - -- name: Configure all hosts with Repositories, Common Files and Set environment key - hosts: - - all:!windows!network - become: true - gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tags: - - step004 - - common_tasks - roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } - -- name: Configuring Bastion Hosts - hosts: bastions - become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa", when: 'install_ipa_client' } - tags: - - step004 - - bastion_tasks - -- name: PreSoftware flight-check - hosts: localhost - connection: local - gather_facts: false - become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tags: - - flight_check - tasks: - - debug: - msg: "Pre-Software checks completed successfully" diff --git a/ansible/configs/archive/ansible-tower-terraform/pre_software.yml b/ansible/configs/archive/ansible-tower-terraform/pre_software.yml deleted file mode 100644 index 69700a9ab65..00000000000 --- a/ansible/configs/archive/ansible-tower-terraform/pre_software.yml +++ /dev/null @@ -1,33 +0,0 @@ -# file: pre_software.yml -- name: Pre-Software | Step 000 Pre Software - hosts: localhost - connection: local - become: False - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" - tags: - - step003 - - pre_software - tasks: - - debug: - msg: "{{ 'tag_Workshop_' + workshop_prefix }}" - - -- name: Pre-Software | Setup Ansible Tower Workshop - hosts: "{{ 'tag_Workshop_' + workshop_prefix }}" - gather_facts: True - become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/subscription_manager" } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/epel" } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/nodejs" } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/wetty" } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/ansible.tower" } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/zsh" } - # - { role: "{{ ANSIBLE_REPO_PATH }}/roles/cockpit" } - - diff --git a/ansible/configs/archive/auth-playground-lab/pre_software.yml b/ansible/configs/archive/auth-playground-lab/pre_software.yml deleted file mode 100644 index 08936911e54..00000000000 --- a/ansible/configs/archive/auth-playground-lab/pre_software.yml +++ /dev/null @@ -1,79 +0,0 @@ ---- -- name: Step 003 - Create env key - hosts: localhost - connection: local - gather_facts: false - become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tags: - - step003 - - generate_env_keys - tasks: - - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" - args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" - when: set_env_authorized_key - -# Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} - -- name: Configure all hosts with Repositories, Common Files and Set environment key - hosts: - - all:!windows - become: true - gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tags: - - step004 - - common_tasks - roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } - -- name: Configuring Bastion Hosts - hosts: bastions - become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa", when: 'install_ipa_client' } - tags: - - step004 - - bastion_tasks - -- name: Configure windows machines - hosts: - - activedirectories - gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tags: - - step004 - - common_tasks - - windows_tasks - roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/windows-common" - when: install_win_ssh - - -- name: PreSoftware flight-check - hosts: localhost - connection: local - gather_facts: false - become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tags: - - flight_check - tasks: - - debug: - msg: "Pre-Software checks completed successfully" diff --git a/ansible/configs/archive/generic-example/destroy_env.yml b/ansible/configs/archive/generic-example/destroy_env.yml deleted file mode 100644 index 753e6c2a905..00000000000 --- a/ansible/configs/archive/generic-example/destroy_env.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- name: Import default CloudFormation (aws) destroy playbook - import_playbook: "{{ANSIBLE_REPO_PATH}}/cloud_providers/{{cloud_provider}}_destroy_env.yml" diff --git a/ansible/configs/archive/generic-example/pre_software.yml b/ansible/configs/archive/generic-example/pre_software.yml deleted file mode 100644 index 153a8e2a1e9..00000000000 --- a/ansible/configs/archive/generic-example/pre_software.yml +++ /dev/null @@ -1,63 +0,0 @@ ---- -- name: Step 003 - Create env key - hosts: localhost - connection: local - gather_facts: false - become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tags: - - step003 - - generate_env_keys - tasks: - - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" - args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" - when: set_env_authorized_key - -# Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} - -- name: Configure all hosts with Repositories, Common Files and Set environment key - hosts: - - all:!windows - become: true - gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tags: - - step004 - - common_tasks - roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } - -- name: Configuring Bastion Hosts - hosts: bastions - become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion" - when: install_bastion|bool - tags: - - step004 - - bastion_tasks - -- name: PreSoftware flight-check - hosts: localhost - connection: local - gather_facts: false - become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tags: - - flight_check - tasks: - - debug: - msg: "Pre-Software checks completed successfully" diff --git a/ansible/configs/archive/linklight-demo/README.adoc b/ansible/configs/archive/linklight-demo/README.adoc index 032b0eabac7..bc0b806e432 100644 --- a/ansible/configs/archive/linklight-demo/README.adoc +++ b/ansible/configs/archive/linklight-demo/README.adoc @@ -42,7 +42,7 @@ $ mydeploy-script.sh --student_workloads=linklight_engine --more_args ... [source,bash] ---- ansible-playbook main.yml \ - -e ANSIBLE_REPO_PATH=${ANSIBLE_REPO_PATH} \ + -e ANSIBLE_REPO_PATH | default('.')=${ANSIBLE_REPO_PATH | default('.')} \ -e guid=${GUID} \ ..... args omitted for brevity -e @configs/linklight/linklight_all_vars.yml \ @@ -111,10 +111,10 @@ EC2_KEYNAME=${GUID}-link STUDENT_TOTAL=2 -ANSIBLE_REPO_PATH=$(pwd) +ANSIBLE_REPO_PATH | default('.')=$(pwd) ansible-playbook main.yml \ - -e ANSIBLE_REPO_PATH=${ANSIBLE_REPO_PATH} \ + -e ANSIBLE_REPO_PATH | default('.')=${ANSIBLE_REPO_PATH | default('.')} \ -e guid=${GUID} \ -e env_type=${ENV_TYPE} \ -e project_tag=${ENV_TYPE}-${GUID} \ @@ -155,10 +155,10 @@ ENV_TYPE=linklight EC2_NAME_PREFIX=${GUID} EC2_REGION=us-east-1 -ANSIBLE_REPO_PATH=$(pwd) +ANSIBLE_REPO_PATH | default('.')=$(pwd) -ansible-playbook ${ANSIBLE_REPO_PATH}/configs/${ENV_TYPE}/destroy_env.yml \ - -e ANSIBLE_REPO_PATH=${ANSIBLE_REPO_PATH} \ +ansible-playbook ${ANSIBLE_REPO_PATH | default('.')}/configs/${ENV_TYPE}/destroy_env.yml \ + -e ANSIBLE_REPO_PATH | default('.')=${ANSIBLE_REPO_PATH | default('.')} \ -e ec2_name_prefix=${GUID} \ -e ec2_region=${EC2_REGION} \ -e @configs/linklight/linklight_all_vars.yml \ diff --git a/ansible/configs/archive/linklight-demo/destroy_env.yml b/ansible/configs/archive/linklight-demo/destroy_env.yml index 45e8b7f3afe..8489463e5ea 100644 --- a/ansible/configs/archive/linklight-demo/destroy_env.yml +++ b/ansible/configs/archive/linklight-demo/destroy_env.yml @@ -3,8 +3,8 @@ connection: local gather_facts: False become: no - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/workdir/linklight/provisioner/teardown_lab.yml" + + + +- import_playbook: "{{workdir_dir}}/linklight/provisioner/teardown_lab.yml" diff --git a/ansible/configs/archive/linklight-demo/post_infra.yml b/ansible/configs/archive/linklight-demo/post_infra.yml index 79266a58866..eeac335d82a 100644 --- a/ansible/configs/archive/linklight-demo/post_infra.yml +++ b/ansible/configs/archive/linklight-demo/post_infra.yml @@ -3,9 +3,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure @@ -44,9 +44,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -104,19 +104,19 @@ - name: Run infra-ec2-create-inventory Role include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-ec2-create-inventory" + name: "infra-ec2-create-inventory" - name: Run Common SSH Config Generator Role include_role: - name: "{{ANSIBLE_REPO_PATH}}/roles/infra-common-ssh-config-generate" + name: "infra-common-ssh-config-generate" - name: ssh workaround thing hosts: all connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure @@ -124,5 +124,5 @@ - name: set facts for remote access set_fact: - ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" + ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{workdir_dir}}/{{ env_type }}_{{ guid }}_ssh_conf" diff --git a/ansible/configs/archive/linklight-demo/post_software.yml b/ansible/configs/archive/linklight-demo/post_software.yml index 2b419864371..ddaa7fc1aa7 100644 --- a/ansible/configs/archive/linklight-demo/post_software.yml +++ b/ansible/configs/archive/linklight-demo/post_software.yml @@ -2,8 +2,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - debug: msg: "Post-Software tasks Started" @@ -14,11 +14,11 @@ become: yes tags: - opentlc_bastion_tasks - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool # sssd bug, fixed by restart @@ -33,9 +33,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/archive/linklight-demo/pre_infra.yml b/ansible/configs/archive/linklight-demo/pre_infra.yml index f8a927b2725..bab001ad56b 100644 --- a/ansible/configs/archive/linklight-demo/pre_infra.yml +++ b/ansible/configs/archive/linklight-demo/pre_infra.yml @@ -3,9 +3,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -18,19 +18,19 @@ - name: Generate SSH keys when set_env_authorized_key block: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{ env_authorized_key }}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" + creates: "{{workdir_dir}}/{{ env_authorized_key }}" - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" + path: "{{workdir_dir}}/{{ env_authorized_key }}" mode: 0400 - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{ env_authorized_key }}" > "{{workdir_dir}}/{{ env_authorized_key }}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}.pub" + creates: "{{workdir_dir}}/{{ env_authorized_key }}.pub" when: set_env_authorized_key - name: PreSoftware flight-check @@ -38,16 +38,16 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: - debug: msg: "Pre-Software checks completed successfully" -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/workdir/linklight/provisioner/provision_lab.yml" +- import_playbook: "{{workdir_dir}}/linklight/provisioner/provision_lab.yml" tags: - linklight_provision @@ -57,9 +57,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check @@ -75,9 +75,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/archive/linklight-demo/pre_software.yml b/ansible/configs/archive/linklight-demo/pre_software.yml index 1ac16bec2d3..0a7e8221c1b 100644 --- a/ansible/configs/archive/linklight-demo/pre_software.yml +++ b/ansible/configs/archive/linklight-demo/pre_software.yml @@ -5,25 +5,25 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } + - { role: "bastion", when: 'install_bastion' } tags: - step004 - bastion_tasks @@ -34,9 +34,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/archive/linklight-engine/README.adoc b/ansible/configs/archive/linklight-engine/README.adoc index 1d1e88a17f3..93348553681 100644 --- a/ansible/configs/archive/linklight-engine/README.adoc +++ b/ansible/configs/archive/linklight-engine/README.adoc @@ -79,10 +79,10 @@ EMAIL_USERS=no CREATE_LOGIN_PAGE=false STUDENT_TOTAL=1 USERS='{"users":[{ "name": "Alice", "username": "alice", "email": "alice@example.com" }, { "name": "Bob", "username":"bob", "email": "bob@example.com" }]}' -ANSIBLE_REPO_PATH=$(pwd) +ANSIBLE_REPO_PATH | default('.')=$(pwd) ansible-playbook main.yml \ - -e ANSIBLE_REPO_PATH=${ANSIBLE_REPO_PATH} \ + -e ANSIBLE_REPO_PATH | default('.')=${ANSIBLE_REPO_PATH | default('.')} \ -e guid=${GUID} \ -e env_type=${ENV_TYPE} \ -e networking=${NETWORKING} \ @@ -133,10 +133,10 @@ EC2_NAME_PREFIX=${GUID} EC2_REGION=us-east-1 EC2_AVAILABILITY_ZONE=us-east-1a -ANSIBLE_REPO_PATH=$(pwd) +ANSIBLE_REPO_PATH | default('.')=$(pwd) -ansible-playbook ${ANSIBLE_REPO_PATH}/configs/${ENV_TYPE}/destroy_env.yml \ - -e ANSIBLE_REPO_PATH=${ANSIBLE_REPO_PATH} \ +ansible-playbook ${ANSIBLE_REPO_PATH | default('.')}/configs/${ENV_TYPE}/destroy_env.yml \ + -e ANSIBLE_REPO_PATH | default('.')=${ANSIBLE_REPO_PATH | default('.')} \ -e ec2_name_prefix=${GUID} \ -e ec2_region=${EC2_REGION} \ -e s3_state=absent \ diff --git a/ansible/configs/archive/linklight-engine/destroy_env.yml b/ansible/configs/archive/linklight-engine/destroy_env.yml index 58420b03140..61687b3353e 100644 --- a/ansible/configs/archive/linklight-engine/destroy_env.yml +++ b/ansible/configs/archive/linklight-engine/destroy_env.yml @@ -3,8 +3,8 @@ connection: local gather_facts: False become: no - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/workdir/linklight-engine/provisioner/teardown_lab.yml" + + + +- import_playbook: "{{workdir_dir}}/linklight-engine/provisioner/teardown_lab.yml" diff --git a/ansible/configs/archive/linklight-engine/post_infra.yml b/ansible/configs/archive/linklight-engine/post_infra.yml index 79266a58866..7dadff7703a 100644 --- a/ansible/configs/archive/linklight-engine/post_infra.yml +++ b/ansible/configs/archive/linklight-engine/post_infra.yml @@ -3,9 +3,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure @@ -44,9 +44,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -104,19 +104,19 @@ - name: Run infra-ec2-create-inventory Role include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-ec2-create-inventory" + name: "infra-ec2-create-inventory" - name: Run Common SSH Config Generator Role include_role: - name: "{{ANSIBLE_REPO_PATH}}/roles/infra-common-ssh-config-generate" + name: "infra-common-ssh-config-generate" - name: ssh workaround thing hosts: all connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure @@ -124,5 +124,5 @@ - name: set facts for remote access set_fact: - ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" + ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{workdir_dir}}/{{ env_type }}_{{ guid }}_ssh_conf" diff --git a/ansible/configs/archive/linklight-engine/post_software.yml b/ansible/configs/archive/linklight-engine/post_software.yml index 2b419864371..b168ad6d99d 100644 --- a/ansible/configs/archive/linklight-engine/post_software.yml +++ b/ansible/configs/archive/linklight-engine/post_software.yml @@ -2,8 +2,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - debug: msg: "Post-Software tasks Started" @@ -14,11 +14,11 @@ become: yes tags: - opentlc_bastion_tasks - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool # sssd bug, fixed by restart @@ -33,9 +33,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/archive/linklight-engine/pre_infra.yml b/ansible/configs/archive/linklight-engine/pre_infra.yml index be0f3db7e7f..432a5427b9d 100644 --- a/ansible/configs/archive/linklight-engine/pre_infra.yml +++ b/ansible/configs/archive/linklight-engine/pre_infra.yml @@ -3,9 +3,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -18,28 +18,28 @@ - name: Generate SSH keys when set_env_authorized_key block: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{ env_authorized_key }}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" + creates: "{{workdir_dir}}/{{ env_authorized_key }}" - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" + path: "{{workdir_dir}}/{{ env_authorized_key }}" mode: 0400 - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{ env_authorized_key }}" > "{{workdir_dir}}/{{ env_authorized_key }}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}.pub" + creates: "{{workdir_dir}}/{{ env_authorized_key }}.pub" when: set_env_authorized_key # tested version on 2018-07-24 fc86de92080165b72906a1477e389cf0298bd499 # - name: Clone Ansible linklight repo locally - specfic commit #git: # repo: https://github.com/network-automation/linklight.git - # dest: "{{ ANSIBLE_REPO_PATH }}/workdir/linklight" + # dest: "{{workdir_dir}}/linklight" # version: fc86de92080165b72906a1477e389cf0298bd499 -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/workdir/linklight-engine/provisioner/provision_lab.yml" +- import_playbook: "{{workdir_dir}}/linklight-engine/provisioner/provision_lab.yml" tags: - linklight_provision diff --git a/ansible/configs/archive/linklight-engine/pre_software.yml b/ansible/configs/archive/linklight-engine/pre_software.yml index 1ac16bec2d3..a358b70d8cb 100644 --- a/ansible/configs/archive/linklight-engine/pre_software.yml +++ b/ansible/configs/archive/linklight-engine/pre_software.yml @@ -5,25 +5,25 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } + - { role: "bastion", when: 'install_bastion' } tags: - step004 - bastion_tasks @@ -34,9 +34,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/archive/linklight-networking-allcisco/README.adoc b/ansible/configs/archive/linklight-networking-allcisco/README.adoc index 247c9728776..cf200e652e5 100644 --- a/ansible/configs/archive/linklight-networking-allcisco/README.adoc +++ b/ansible/configs/archive/linklight-networking-allcisco/README.adoc @@ -81,10 +81,10 @@ CREATE_LOGIN_PAGE=false STUDENT_TOTAL=1 USERS='{"users":[{ "name": "Alice", "username": "alice", "email": "alice@example.com" }, { "name": "Bob", "username":"bob", "email": "bob@example.com" }]}' -ANSIBLE_REPO_PATH=$(pwd) +ANSIBLE_REPO_PATH | default('.')=$(pwd) ansible-playbook main.yml \ - -e ANSIBLE_REPO_PATH=${ANSIBLE_REPO_PATH} \ + -e ANSIBLE_REPO_PATH | default('.')=${ANSIBLE_REPO_PATH | default('.')} \ -e host_key_checking=False \ -e guid=${GUID} \ -e env_type=${ENV_TYPE} \ @@ -137,10 +137,10 @@ EC2_NAME_PREFIX=${GUID} EC2_REGION=us-east-1 EC2_AVAILABILITY_ZONE=us-east-1a -ANSIBLE_REPO_PATH=$(pwd) +ANSIBLE_REPO_PATH | default('.')=$(pwd) -ansible-playbook ${ANSIBLE_REPO_PATH}/configs/${ENV_TYPE}/destroy_env.yml \ - -e ANSIBLE_REPO_PATH=${ANSIBLE_REPO_PATH} \ +ansible-playbook ${ANSIBLE_REPO_PATH | default('.')}/configs/${ENV_TYPE}/destroy_env.yml \ + -e ANSIBLE_REPO_PATH | default('.')=${ANSIBLE_REPO_PATH | default('.')} \ -e 'host_key_checking=False \ -e ec2_name_prefix=${GUID} \ -e ec2_region=${EC2_REGION} \ diff --git a/ansible/configs/archive/linklight-networking-allcisco/destroy_env.yml b/ansible/configs/archive/linklight-networking-allcisco/destroy_env.yml index c816bbed201..881048e0f2a 100644 --- a/ansible/configs/archive/linklight-networking-allcisco/destroy_env.yml +++ b/ansible/configs/archive/linklight-networking-allcisco/destroy_env.yml @@ -3,8 +3,8 @@ connection: local gather_facts: False become: no - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/workdir/linklight-networking-allcisco/provisioner/teardown_lab.yml" + + + +- import_playbook: "{{workdir_dir}}/linklight-networking-allcisco/provisioner/teardown_lab.yml" diff --git a/ansible/configs/archive/linklight-networking-allcisco/post_infra.yml b/ansible/configs/archive/linklight-networking-allcisco/post_infra.yml index 79266a58866..7dadff7703a 100644 --- a/ansible/configs/archive/linklight-networking-allcisco/post_infra.yml +++ b/ansible/configs/archive/linklight-networking-allcisco/post_infra.yml @@ -3,9 +3,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure @@ -44,9 +44,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -104,19 +104,19 @@ - name: Run infra-ec2-create-inventory Role include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-ec2-create-inventory" + name: "infra-ec2-create-inventory" - name: Run Common SSH Config Generator Role include_role: - name: "{{ANSIBLE_REPO_PATH}}/roles/infra-common-ssh-config-generate" + name: "infra-common-ssh-config-generate" - name: ssh workaround thing hosts: all connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure @@ -124,5 +124,5 @@ - name: set facts for remote access set_fact: - ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" + ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{workdir_dir}}/{{ env_type }}_{{ guid }}_ssh_conf" diff --git a/ansible/configs/archive/linklight-networking-allcisco/post_software.yml b/ansible/configs/archive/linklight-networking-allcisco/post_software.yml index 2b419864371..b168ad6d99d 100644 --- a/ansible/configs/archive/linklight-networking-allcisco/post_software.yml +++ b/ansible/configs/archive/linklight-networking-allcisco/post_software.yml @@ -2,8 +2,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - debug: msg: "Post-Software tasks Started" @@ -14,11 +14,11 @@ become: yes tags: - opentlc_bastion_tasks - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool # sssd bug, fixed by restart @@ -33,9 +33,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/archive/linklight-networking-allcisco/pre_infra.yml b/ansible/configs/archive/linklight-networking-allcisco/pre_infra.yml index f727549d226..150fe30b289 100644 --- a/ansible/configs/archive/linklight-networking-allcisco/pre_infra.yml +++ b/ansible/configs/archive/linklight-networking-allcisco/pre_infra.yml @@ -3,9 +3,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -18,41 +18,41 @@ - name: Generate SSH keys when set_env_authorized_key block: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{ env_authorized_key }}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" + creates: "{{workdir_dir}}/{{ env_authorized_key }}" - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" + path: "{{workdir_dir}}/{{ env_authorized_key }}" mode: 0400 - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{ env_authorized_key }}" > "{{workdir_dir}}/{{ env_authorized_key }}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}.pub" + creates: "{{workdir_dir}}/{{ env_authorized_key }}.pub" when: set_env_authorized_key # tested version on 2018-07-24 fc86de92080165b72906a1477e389cf0298bd499 # - name: Clone Ansible linklight repo locally - specfic commit #git: # repo: https://github.com/network-automation/linklight.git - # dest: "{{ ANSIBLE_REPO_PATH }}/workdir/linklight" + # dest: "{{workdir_dir}}/linklight" # version: fc86de92080165b72906a1477e389cf0298bd499 - name: PreSoftware flight-check hosts: localhost connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: - debug: msg: "Pre-Software checks completed successfully" -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/workdir/linklight-networking-allcisco/provisioner/provision_lab.yml" +- import_playbook: "{{workdir_dir}}/linklight-networking-allcisco/provisioner/provision_lab.yml" tags: - linklight_provision @@ -62,9 +62,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/archive/linklight-networking-allcisco/pre_software.yml b/ansible/configs/archive/linklight-networking-allcisco/pre_software.yml index 1ac16bec2d3..a358b70d8cb 100644 --- a/ansible/configs/archive/linklight-networking-allcisco/pre_software.yml +++ b/ansible/configs/archive/linklight-networking-allcisco/pre_software.yml @@ -5,25 +5,25 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } + - { role: "bastion", when: 'install_bastion' } tags: - step004 - bastion_tasks @@ -34,9 +34,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/archive/linklight-networking/README.adoc b/ansible/configs/archive/linklight-networking/README.adoc index 8b9aa289496..10eb23d7b03 100644 --- a/ansible/configs/archive/linklight-networking/README.adoc +++ b/ansible/configs/archive/linklight-networking/README.adoc @@ -81,10 +81,10 @@ CREATE_LOGIN_PAGE=false STUDENT_TOTAL=1 USERS='{"users":[{ "name": "Alice", "username": "alice", "email": "alice@example.com" }, { "name": "Bob", "username":"bob", "email": "bob@example.com" }]}' -ANSIBLE_REPO_PATH=$(pwd) +ANSIBLE_REPO_PATH | default('.')=$(pwd) ansible-playbook main.yml \ - -e ANSIBLE_REPO_PATH=${ANSIBLE_REPO_PATH} \ + -e ANSIBLE_REPO_PATH | default('.')=${ANSIBLE_REPO_PATH | default('.')} \ -e host_key_checking=False \ -e guid=${GUID} \ -e env_type=${ENV_TYPE} \ @@ -137,10 +137,10 @@ EC2_NAME_PREFIX=${GUID} EC2_REGION=us-east-1 EC2_AVAILABILITY_ZONE=us-east-1a -ANSIBLE_REPO_PATH=$(pwd) +ANSIBLE_REPO_PATH | default('.')=$(pwd) -ansible-playbook ${ANSIBLE_REPO_PATH}/configs/${ENV_TYPE}/destroy_env.yml \ - -e ANSIBLE_REPO_PATH=${ANSIBLE_REPO_PATH} \ +ansible-playbook ${ANSIBLE_REPO_PATH | default('.')}/configs/${ENV_TYPE}/destroy_env.yml \ + -e ANSIBLE_REPO_PATH | default('.')=${ANSIBLE_REPO_PATH | default('.')} \ -e 'host_key_checking=False \ -e ec2_name_prefix=${GUID} \ -e ec2_region=${EC2_REGION} \ diff --git a/ansible/configs/archive/linklight-networking/destroy_env.yml b/ansible/configs/archive/linklight-networking/destroy_env.yml index 57e0bd8c89e..cef9acbd150 100644 --- a/ansible/configs/archive/linklight-networking/destroy_env.yml +++ b/ansible/configs/archive/linklight-networking/destroy_env.yml @@ -3,8 +3,8 @@ connection: local gather_facts: False become: no - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/workdir/linklight-networking/provisioner/teardown_lab.yml" + + + +- import_playbook: "{{workdir_dir}}/linklight-networking/provisioner/teardown_lab.yml" diff --git a/ansible/configs/archive/linklight-networking/post_infra.yml b/ansible/configs/archive/linklight-networking/post_infra.yml index 79266a58866..7dadff7703a 100644 --- a/ansible/configs/archive/linklight-networking/post_infra.yml +++ b/ansible/configs/archive/linklight-networking/post_infra.yml @@ -3,9 +3,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure @@ -44,9 +44,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -104,19 +104,19 @@ - name: Run infra-ec2-create-inventory Role include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-ec2-create-inventory" + name: "infra-ec2-create-inventory" - name: Run Common SSH Config Generator Role include_role: - name: "{{ANSIBLE_REPO_PATH}}/roles/infra-common-ssh-config-generate" + name: "infra-common-ssh-config-generate" - name: ssh workaround thing hosts: all connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure @@ -124,5 +124,5 @@ - name: set facts for remote access set_fact: - ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" + ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{workdir_dir}}/{{ env_type }}_{{ guid }}_ssh_conf" diff --git a/ansible/configs/archive/linklight-networking/post_software.yml b/ansible/configs/archive/linklight-networking/post_software.yml index 2b419864371..b168ad6d99d 100644 --- a/ansible/configs/archive/linklight-networking/post_software.yml +++ b/ansible/configs/archive/linklight-networking/post_software.yml @@ -2,8 +2,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - debug: msg: "Post-Software tasks Started" @@ -14,11 +14,11 @@ become: yes tags: - opentlc_bastion_tasks - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool # sssd bug, fixed by restart @@ -33,9 +33,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/archive/linklight-networking/pre_infra.yml b/ansible/configs/archive/linklight-networking/pre_infra.yml index 9ee384a51bc..71b7ec2eed8 100644 --- a/ansible/configs/archive/linklight-networking/pre_infra.yml +++ b/ansible/configs/archive/linklight-networking/pre_infra.yml @@ -3,9 +3,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -18,42 +18,42 @@ - name: Generate SSH keys when set_env_authorized_key block: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{ env_authorized_key }}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" + creates: "{{workdir_dir}}/{{ env_authorized_key }}" - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" + path: "{{workdir_dir}}/{{ env_authorized_key }}" mode: 0400 - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{ env_authorized_key }}" > "{{workdir_dir}}/{{ env_authorized_key }}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}.pub" + creates: "{{workdir_dir}}/{{ env_authorized_key }}.pub" when: set_env_authorized_key # tested version on 2018-07-24 fc86de92080165b72906a1477e389cf0298bd499 # - name: Clone Ansible linklight repo locally - specfic commit #git: # repo: https://github.com/network-automation/linklight.git - # dest: "{{ ANSIBLE_REPO_PATH }}/workdir/linklight" + # dest: "{{workdir_dir}}/linklight" # version: fc86de92080165b72906a1477e389cf0298bd499 - name: PreSoftware flight-check hosts: localhost connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: - debug: msg: "Pre-Software checks completed successfully" -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/workdir/linklight-networking/provisioner/provision_lab.yml" +- import_playbook: "{{workdir_dir}}/linklight-networking/provisioner/provision_lab.yml" tags: - linklight_provision @@ -63,9 +63,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/archive/linklight-networking/pre_software.yml b/ansible/configs/archive/linklight-networking/pre_software.yml index 1ac16bec2d3..a358b70d8cb 100644 --- a/ansible/configs/archive/linklight-networking/pre_software.yml +++ b/ansible/configs/archive/linklight-networking/pre_software.yml @@ -5,25 +5,25 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } + - { role: "bastion", when: 'install_bastion' } tags: - step004 - bastion_tasks @@ -34,9 +34,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/pre_software.yml b/ansible/configs/archive/ocp-adv-deploy-hw/pre_software.yml deleted file mode 100644 index 77ab9933a72..00000000000 --- a/ansible/configs/archive/ocp-adv-deploy-hw/pre_software.yml +++ /dev/null @@ -1,74 +0,0 @@ - -- name: Step 003 - Create env key - hosts: localhost - connection: local - gather_facts: false - become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tags: - - step003 - - generate_env_keys - tasks: - - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" - args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" - when: set_env_authorized_key - - - name: fix permission - file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" - mode: 0400 - when: set_env_authorized_key - - - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" - args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" - when: set_env_authorized_key - -# Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} - -- name: Configure all hosts with Repositories, Common Files and Set environment key - hosts: all - become: true - gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tags: - - step004 - - common_tasks - roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } - -- name: Configuring Bastion Hosts - hosts: bastions - become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } - tags: - - step004 - - bastion_tasks - - -- name: PreSoftware flight-check - hosts: localhost - connection: local - gather_facts: false - become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tags: - - flight_check - tasks: - - debug: - msg: "Pre-Software checks completed successfully" diff --git a/ansible/configs/archive/ocp-implementation-lab-2/pre_software.yml b/ansible/configs/archive/ocp-implementation-lab-2/pre_software.yml deleted file mode 100644 index 0a5e5c032a4..00000000000 --- a/ansible/configs/archive/ocp-implementation-lab-2/pre_software.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -- name: Step 003 - Create env key - hosts: localhost - connection: local - gather_facts: false - become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tags: - - step003 - - generate_env_keys - tasks: - - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" - args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" - when: set_env_authorized_key - -# Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} - -- name: Configure all hosts with Repositories, Common Files and Set environment key - hosts: - - all:!windows - become: true - gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tags: - - step004 - - common_tasks - roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } - -- name: Configuring Bastion Hosts - hosts: bastions - become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } - tags: - - step004 - - bastion_tasks - -- name: PreSoftware flight-check - hosts: localhost - connection: local - gather_facts: false - become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tags: - - flight_check - tasks: - - debug: - msg: "Pre-Software checks completed successfully" diff --git a/ansible/configs/archive/ravello-bastion-setup/ssh_vars.yml b/ansible/configs/archive/ravello-bastion-setup/ssh_vars.yml deleted file mode 100644 index a3d48ebfaaf..00000000000 --- a/ansible/configs/archive/ravello-bastion-setup/ssh_vars.yml +++ /dev/null @@ -1 +0,0 @@ -ansible_ssh_common_args: -o ProxyCommand="ssh -i {{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }} -W %h:%p -q cloud-user@{{ groups['bastion_host'].0 }}" diff --git a/ansible/configs/archive/rhte-ansible-net/README.adoc b/ansible/configs/archive/rhte-ansible-net/README.adoc index 498503716a3..7c7a555aab1 100644 --- a/ansible/configs/archive/rhte-ansible-net/README.adoc +++ b/ansible/configs/archive/rhte-ansible-net/README.adoc @@ -81,10 +81,10 @@ EMAIL_USERS=no CREATE_LOGIN_PAGE=false STUDENT_TOTAL=2 #USERS='{"users":[{ "name": "Alice", "username": "alice", "email": "alice@example.com" }, { "name": "Bob", "username":"bob", "email": "bob@example.com" }]}' -ANSIBLE_REPO_PATH=$(pwd) +ANSIBLE_REPO_PATH | default('.')=$(pwd) ansible-playbook main.yml \ - -e ANSIBLE_REPO_PATH=${ANSIBLE_REPO_PATH} \ + -e ANSIBLE_REPO_PATH | default('.')=${ANSIBLE_REPO_PATH | default('.')} \ -e guid=${GUID} \ -e env_type=${ENV_TYPE} \ -e networking=${NETWORKING} \ @@ -137,10 +137,10 @@ EC2_NAME_PREFIX=${GUID} EC2_REGION=us-east-1 EC2_AVAILABILITY_ZONE=us-east-1a -ANSIBLE_REPO_PATH=$(pwd) +ANSIBLE_REPO_PATH | default('.')=$(pwd) -ansible-playbook ${ANSIBLE_REPO_PATH}/configs/${ENV_TYPE}/destroy_env.yml \ - -e ANSIBLE_REPO_PATH=${ANSIBLE_REPO_PATH} \ +ansible-playbook ${ANSIBLE_REPO_PATH | default('.')}/configs/${ENV_TYPE}/destroy_env.yml \ + -e ANSIBLE_REPO_PATH | default('.')=${ANSIBLE_REPO_PATH | default('.')} \ -e ec2_name_prefix=${GUID} \ -e ec2_region=${EC2_REGION} \ -e ec2_az=${EC2_AVAILABILITY_ZONE}· diff --git a/ansible/configs/archive/rhte-ansible-net/destroy_env.yml b/ansible/configs/archive/rhte-ansible-net/destroy_env.yml index 21c8ce04b49..befd3bd6490 100644 --- a/ansible/configs/archive/rhte-ansible-net/destroy_env.yml +++ b/ansible/configs/archive/rhte-ansible-net/destroy_env.yml @@ -3,8 +3,8 @@ connection: local gather_facts: False become: no - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/workdir/rhte-ansible-net/provisioner/teardown_lab.yml" +- import_playbook: "{{workdir_dir}}/rhte-ansible-net/provisioner/teardown_lab.yml" diff --git a/ansible/configs/archive/rhte-ansible-net/post_infra.yml b/ansible/configs/archive/rhte-ansible-net/post_infra.yml index 79266a58866..eeac335d82a 100644 --- a/ansible/configs/archive/rhte-ansible-net/post_infra.yml +++ b/ansible/configs/archive/rhte-ansible-net/post_infra.yml @@ -3,9 +3,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure @@ -44,9 +44,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -104,19 +104,19 @@ - name: Run infra-ec2-create-inventory Role include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-ec2-create-inventory" + name: "infra-ec2-create-inventory" - name: Run Common SSH Config Generator Role include_role: - name: "{{ANSIBLE_REPO_PATH}}/roles/infra-common-ssh-config-generate" + name: "infra-common-ssh-config-generate" - name: ssh workaround thing hosts: all connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure @@ -124,5 +124,5 @@ - name: set facts for remote access set_fact: - ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" + ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{workdir_dir}}/{{ env_type }}_{{ guid }}_ssh_conf" diff --git a/ansible/configs/archive/rhte-ansible-net/post_software.yml b/ansible/configs/archive/rhte-ansible-net/post_software.yml index 2b419864371..ddaa7fc1aa7 100644 --- a/ansible/configs/archive/rhte-ansible-net/post_software.yml +++ b/ansible/configs/archive/rhte-ansible-net/post_software.yml @@ -2,8 +2,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - debug: msg: "Post-Software tasks Started" @@ -14,11 +14,11 @@ become: yes tags: - opentlc_bastion_tasks - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool # sssd bug, fixed by restart @@ -33,9 +33,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/archive/rhte-ansible-net/pre_infra.yml b/ansible/configs/archive/rhte-ansible-net/pre_infra.yml index 52ce12dd016..52a226b11ac 100644 --- a/ansible/configs/archive/rhte-ansible-net/pre_infra.yml +++ b/ansible/configs/archive/rhte-ansible-net/pre_infra.yml @@ -3,9 +3,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -18,26 +18,26 @@ - name: Generate SSH keys when set_env_authorized_key block: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{ env_authorized_key }}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" + creates: "{{workdir_dir}}/{{ env_authorized_key }}" - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" + path: "{{workdir_dir}}/{{ env_authorized_key }}" mode: 0400 - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{ env_authorized_key }}" > "{{workdir_dir}}/{{ env_authorized_key }}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}.pub" + creates: "{{workdir_dir}}/{{ env_authorized_key }}.pub" when: set_env_authorized_key # tested version on 2018-07-24 fc86de92080165b72906a1477e389cf0298bd499 # - name: Clone Ansible linklight repo locally - specfic commit #git: # repo: https://github.com/network-automation/linklight.git - # dest: "{{ ANSIBLE_REPO_PATH }}/workdir/linklight" + # dest: "{{workdir_dir}}/linklight" # version: fc86de92080165b72906a1477e389cf0298bd499 @@ -47,9 +47,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: @@ -57,7 +57,7 @@ msg: "Pre-Software checks completed successfully" -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/workdir/rhte-ansible-net/provisioner/provision_lab.yml" +- import_playbook: "{{workdir_dir}}/rhte-ansible-net/provisioner/provision_lab.yml" tags: - rnet_invoke @@ -66,9 +66,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/archive/rhte-ansible-net/pre_software.yml b/ansible/configs/archive/rhte-ansible-net/pre_software.yml index 1ac16bec2d3..0a7e8221c1b 100644 --- a/ansible/configs/archive/rhte-ansible-net/pre_software.yml +++ b/ansible/configs/archive/rhte-ansible-net/pre_software.yml @@ -5,25 +5,25 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } + - { role: "bastion", when: 'install_bastion' } tags: - step004 - bastion_tasks @@ -34,9 +34,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/archive/single-ipa/ssh_vars.yml b/ansible/configs/archive/single-ipa/ssh_vars.yml deleted file mode 100644 index 8d6dbe2ebe7..00000000000 --- a/ansible/configs/archive/single-ipa/ssh_vars.yml +++ /dev/null @@ -1 +0,0 @@ -ansible_ssh_extra_args: "-F {{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf -o StrictHostKeyChecking=no" diff --git a/ansible/configs/archive/three-tier-tower/README.adoc b/ansible/configs/archive/three-tier-tower/README.adoc index cf1892f38ec..142c4237268 100644 --- a/ansible/configs/archive/three-tier-tower/README.adoc +++ b/ansible/configs/archive/three-tier-tower/README.adoc @@ -60,7 +60,7 @@ DEPLOYER_REPO_PATH=`pwd` ansible-playbook \ ${DEPLOYER_REPO_PATH}/main.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" \ -e "env_type=${ENVTYPE}" \ -e "key_name=${KEYNAME}" \ @@ -87,7 +87,7 @@ ENVTYPE="three-tier-app" CLOUDPROVIDER=ec2 #To Destroy an Env ansible-playbook ./configs/${ENVTYPE}/destroy_env.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" -e "env_type=${ENVTYPE}" -e "cloud_provider=${CLOUDPROVIDER}" -e "aws_region=${REGION}" \ -e "HostedZoneId=${HOSTZONEID}" -e "key_name=${KEYNAME}" -e "subdomain_base_suffix=${BASESUFFIX}" diff --git a/ansible/configs/archive/three-tier-tower/destroy_env.yml b/ansible/configs/archive/three-tier-tower/destroy_env.yml index 4d37b2696a8..54114c2c91e 100644 --- a/ansible/configs/archive/three-tier-tower/destroy_env.yml +++ b/ansible/configs/archive/three-tier-tower/destroy_env.yml @@ -1,3 +1,3 @@ --- - name: Import default destroy playbook - import_playbook: "{{ANSIBLE_REPO_PATH}}/cloud_providers/{{cloud_provider}}_destroy_env.yml" + import_playbook: "{{workdir_dir}}/cloud_providers/{{cloud_provider}}_destroy_env.yml" diff --git a/ansible/configs/archive/three-tier-tower/env_vars.yml b/ansible/configs/archive/three-tier-tower/env_vars.yml index 66eb713a001..7a28b44749a 100644 --- a/ansible/configs/archive/three-tier-tower/env_vars.yml +++ b/ansible/configs/archive/three-tier-tower/env_vars.yml @@ -35,7 +35,7 @@ project_tag: "{{ env_type }}-{{ guid }}" # This is where the ssh_config file will be created, this file is used to # define the communication method to all the hosts in the deployment -deploy_local_ssh_config_location: "{{ANSIBLE_REPO_PATH}}/workdir" +deploy_local_ssh_config_location: "{{workdir_dir}}/" install_bastion: true install_common: true diff --git a/ansible/configs/archive/three-tier-tower/post_infra.yml b/ansible/configs/archive/three-tier-tower/post_infra.yml index cb74cb0897c..a4e7362ed19 100644 --- a/ansible/configs/archive/three-tier-tower/post_infra.yml +++ b/ansible/configs/archive/three-tier-tower/post_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure diff --git a/ansible/configs/archive/three-tier-tower/post_software.yml b/ansible/configs/archive/three-tier-tower/post_software.yml index 2b419864371..ddaa7fc1aa7 100644 --- a/ansible/configs/archive/three-tier-tower/post_software.yml +++ b/ansible/configs/archive/three-tier-tower/post_software.yml @@ -2,8 +2,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - debug: msg: "Post-Software tasks Started" @@ -14,11 +14,11 @@ become: yes tags: - opentlc_bastion_tasks - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool # sssd bug, fixed by restart @@ -33,9 +33,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/archive/three-tier-tower/pre_infra.yml b/ansible/configs/archive/three-tier-tower/pre_infra.yml index 90178ba789a..f53897e59e2 100644 --- a/ansible/configs/archive/three-tier-tower/pre_infra.yml +++ b/ansible/configs/archive/three-tier-tower/pre_infra.yml @@ -3,9 +3,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -15,19 +15,19 @@ msg: "Step 000 Pre Infrastructure" - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{workdir_dir}}/{{env_authorized_key}}" when: set_env_authorized_key - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + path: "{{workdir_dir}}/{{env_authorized_key}}" mode: 0400 when: set_env_authorized_key - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{env_authorized_key}}" > "{{workdir_dir}}/{{env_authorized_key}}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + creates: "{{workdir_dir}}/{{env_authorized_key}}.pub" when: set_env_authorized_key diff --git a/ansible/configs/archive/three-tier-tower/pre_software.yml b/ansible/configs/archive/three-tier-tower/pre_software.yml index 1ac16bec2d3..ebf39240942 100644 --- a/ansible/configs/archive/three-tier-tower/pre_software.yml +++ b/ansible/configs/archive/three-tier-tower/pre_software.yml @@ -5,25 +5,25 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } + - { role: "bastion", when: 'install_bastion' } tags: - step004 - bastion_tasks @@ -34,9 +34,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/bu-workshop/cleanup.yml b/ansible/configs/bu-workshop/cleanup.yml index 2ec3f9fb894..0e05381bfa6 100644 --- a/ansible/configs/bu-workshop/cleanup.yml +++ b/ansible/configs/bu-workshop/cleanup.yml @@ -4,9 +4,9 @@ hosts: localhost connection: local become: false - vars_files: - - "env_vars.yml" - - "env_secret_vars.yml" + + + tasks: - name: Delete S3 bucket environment: @@ -36,28 +36,28 @@ - name: Remove SSH config file: - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" + dest: "{{workdir_dir}}/{{ env_type }}_{{ guid }}_ssh_conf" state: absent tags: - remove_ssh_config - name: Remove SSH bastion config file: - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/ssh-config-{{ env_type }}-{{ guid }}" + dest: "{{workdir_dir}}/ssh-config-{{ env_type }}-{{ guid }}" state: absent tags: - remove_hosts_file - name: Remove cloud template file: - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ cloud_provider }}_cloud_template.{{ env_type }}.{{ guid }}.json" + dest: "{{workdir_dir}}/{{ cloud_provider }}_cloud_template.{{ env_type }}.{{ guid }}.json" state: absent tags: - remove_cloud_template - name: Remove hosts file file: - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ env_type }}-{{ guid }}" + dest: "{{workdir_dir}}/hosts-{{ env_type }}-{{ guid }}" state: absent tags: - remove_hosts_file diff --git a/ansible/configs/bu-workshop/files/userprovision.yaml b/ansible/configs/bu-workshop/files/userprovision.yaml index 08cb5e232e7..90548ad024c 100644 --- a/ansible/configs/bu-workshop/files/userprovision.yaml +++ b/ansible/configs/bu-workshop/files/userprovision.yaml @@ -3,7 +3,7 @@ - name: Workshop users hosts: localhost become: yes - vars_files: + - "bu-workshop_vars.yml" vars: - oc_path: "/usr/local/bin/oc" diff --git a/ansible/configs/bu-workshop/post_software.yml b/ansible/configs/bu-workshop/post_software.yml index 440c625a4d2..f0b8e1ff959 100644 --- a/ansible/configs/bu-workshop/post_software.yml +++ b/ansible/configs/bu-workshop/post_software.yml @@ -18,9 +18,9 @@ hosts: - "{{ ('tag_' ~ env_type ~ '_' ~ guid ~ '_support') | replace('-', '_') }}" gather_facts: False - vars_files: - - "env_vars.yml" - - "env_secret_vars.yml" + + + - "ssh_vars.yml" tags: - workshop @@ -34,9 +34,9 @@ - name: Create Workshop NFS shares hosts: - "{{ ('tag_' ~ env_type ~ '_' ~ guid ~ '_support') | replace('-', '_') }}" - vars_files: - - "env_vars.yml" - - "env_secret_vars.yml" + + + - "ssh_vars.yml" tags: - workshop @@ -74,9 +74,9 @@ - name: NFS volume configuration hosts: - "{{ ('tag_' ~ env_type ~ '_' ~ guid ~ '_master') | replace('-', '_') }}" - vars_files: - - "env_vars.yml" - - "env_secret_vars.yml" + + + - "ssh_vars.yml" tags: - workshop @@ -92,7 +92,7 @@ # TODO: I think I can get rid of this pvs because I do it later - name: Generate PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/files/pvs.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/files/pvs.j2" dest: "/root/pvs-{{ env_type }}-{{ guid }}.yml" tags: - gen_pv_file @@ -103,7 +103,7 @@ - name: Generate user vol PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/files/userpvs.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/files/userpvs.j2" dest: "/root/userpvs-{{ env_type }}-{{ guid }}.yml" tags: - gen_user_vol_pv @@ -117,9 +117,9 @@ - name: Workshop admins hosts: - "{{ ('tag_' ~ env_type ~ '_' ~ guid ~ '_master') | replace('-', '_') }}" - vars_files: - - "env_vars.yml" - - "env_secret_vars.yml" + + + - "ssh_vars.yml" tags: - workshop @@ -138,9 +138,9 @@ - name: Workshop PVs hosts: - "{{ ('tag_' ~ env_type ~ '_' ~ guid ~ '_master') | replace('-', '_') }}" - vars_files: - - "env_vars.yml" - - "env_secret_vars.yml" + + + - "ssh_vars.yml" tags: - workshop @@ -163,9 +163,9 @@ - name: Workshop prerequisites hosts: - "{{ ('tag_' ~ env_type ~ '_' ~ guid ~ '_master') | replace('-', '_') }}" - vars_files: - - "env_vars.yml" - - "env_secret_vars.yml" + + + - "ssh_vars.yml" tags: - workshop @@ -220,9 +220,9 @@ - name: Gitlab hosts: - "{{ ('tag_' ~ env_type ~ '_' ~ guid ~ '_master') | replace('-', '_') }}" - vars_files: - - "env_vars.yml" - - "env_secret_vars.yml" + + + - "ssh_vars.yml" tags: - workshop @@ -272,9 +272,9 @@ - name: Lab guide hosts: - "{{ ('tag_' ~ env_type ~ '_' ~ guid ~ '_master') | replace('-', '_') }}" - vars_files: - - "env_vars.yml" - - "env_secret_vars.yml" + + + - "ssh_vars.yml" tags: - workshop @@ -305,9 +305,9 @@ - name: GitLab nfs permissions hack hosts: - "{{ ('tag_' ~ env_type ~ '_' ~ guid ~ '_support') | replace('-', '_') }}" - vars_files: - - "env_vars.yml" - - "env_secret_vars.yml" + + + - "ssh_vars.yml" tags: - workshop @@ -330,9 +330,9 @@ - name: Project Request Template hosts: - "{{ ('tag_' ~ env_type ~ '_' ~ guid ~ '_master') | replace('-', '_') }}" - vars_files: - - "env_vars.yml" - - "env_secret_vars.yml" + + + - "ssh_vars.yml" tags: - workshop @@ -351,9 +351,9 @@ - name: Workshop Users hosts: - "{{ ('tag_' ~ env_type ~ '_' ~ guid ~ '_master') | replace('-', '_') }}" - vars_files: - - "env_vars.yml" - - "env_secret_vars.yml" + + + - "ssh_vars.yml" tags: - workshop @@ -409,9 +409,9 @@ - name: Deploy etherpad hosts: - "{{ ('tag_' ~ env_type ~ '_' ~ guid ~ '_master') | replace('-', '_') }}" - vars_files: - - "env_vars.yml" - - "env_secret_vars.yml" + + + - "ssh_vars.yml" tags: - workshop diff --git a/ansible/configs/bu-workshop/ssh_vars.yml b/ansible/configs/bu-workshop/ssh_vars.yml index 8d6dbe2ebe7..fed512a13f5 100644 --- a/ansible/configs/bu-workshop/ssh_vars.yml +++ b/ansible/configs/bu-workshop/ssh_vars.yml @@ -1 +1 @@ -ansible_ssh_extra_args: "-F {{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf -o StrictHostKeyChecking=no" +ansible_ssh_extra_args: "-F {{workdir_dir}}/{{ env_type }}_{{ guid }}_ssh_conf -o StrictHostKeyChecking=no" diff --git a/ansible/configs/just-some-nodes-example/README.adoc b/ansible/configs/just-some-nodes-example/README.adoc index 5a086cab014..96966529638 100644 --- a/ansible/configs/just-some-nodes-example/README.adoc +++ b/ansible/configs/just-some-nodes-example/README.adoc @@ -67,7 +67,7 @@ DEPLOYER_REPO_PATH=`pwd` ansible-playbook \ ${DEPLOYER_REPO_PATH}/main.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" -e "env_type=${ENVTYPE}" \ -e "cloud_provider=${CLOUDPROVIDER}" -e"key_name=ocpkey" -e"ssh_key=ocpkey"\ -e "email=sborenst@redhat.com" \ @@ -89,7 +89,7 @@ CLOUDPROVIDER=ec2 DEPLOYER_REPO_PATH=`pwd` #To Destroy an Env ansible-playbook ./configs/${ENVTYPE}/destroy_env.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" -e "env_type=${ENVTYPE}" -e "cloud_provider=${CLOUDPROVIDER}" -e "aws_region=${REGION}" ---- diff --git a/ansible/configs/just-some-nodes-example/destroy_env.yml b/ansible/configs/just-some-nodes-example/destroy_env.yml index f17522d5532..7a5389c5709 100644 --- a/ansible/configs/just-some-nodes-example/destroy_env.yml +++ b/ansible/configs/just-some-nodes-example/destroy_env.yml @@ -8,10 +8,10 @@ tasks: - name: Run infra-ec2-template-destroy include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-{{cloud_provider}}-template-destroy" + name: "infra-{{cloud_provider}}-template-destroy" when: cloud_provider == 'ec2' - name: Run infra-azure-template-destroy include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-{{cloud_provider}}-template-destroy" + name: "infra-{{cloud_provider}}-template-destroy" when: cloud_provider == 'azure' diff --git a/ansible/configs/just-some-nodes-example/env_vars.yml b/ansible/configs/just-some-nodes-example/env_vars.yml index 10719ccb2b3..9c4f61f06d1 100644 --- a/ansible/configs/just-some-nodes-example/env_vars.yml +++ b/ansible/configs/just-some-nodes-example/env_vars.yml @@ -122,7 +122,7 @@ software_to_deploy: none ###V2WORK, these should just be set as default listed in the documentation # This is where the ssh_config file will be created, this file is used to # define the communication method to all the hosts in the deployment -deploy_local_ssh_config_location: "{{ANSIBLE_REPO_PATH}}/workdir" +deploy_local_ssh_config_location: "{{workdir_dir}}/" ### If you want a Key Pair name created and injected into the hosts, diff --git a/ansible/configs/just-some-nodes-example/pre_software.yml b/ansible/configs/just-some-nodes-example/pre_software.yml index b3a7b711b16..5fdc2ff62b9 100644 --- a/ansible/configs/just-some-nodes-example/pre_software.yml +++ b/ansible/configs/just-some-nodes-example/pre_software.yml @@ -7,7 +7,7 @@ msg: "Step 003 Pre Software" - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-local-create-ssh_key" + name: "infra-local-create-ssh_key" when: set_env_authorized_key | bool @@ -19,13 +19,13 @@ tags: - common_tasks roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories" + - role: "set-repositories" when: repo_method is defined - - role: "{{ ANSIBLE_REPO_PATH }}/roles/common" + - role: "common" when: install_common | bool - - role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key" + - role: "set_env_authorized_key" when: set_env_authorized_key | bool - name: Configuring Bastion Hosts @@ -33,7 +33,7 @@ become: true gather_facts: False roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion" + - role: "bastion" when: install_bastion | bool tags: - bastion_tasks diff --git a/ansible/configs/just-some-nodes-example/software.yml b/ansible/configs/just-some-nodes-example/software.yml index ea46bde60be..42f72d3ade7 100644 --- a/ansible/configs/just-some-nodes-example/software.yml +++ b/ansible/configs/just-some-nodes-example/software.yml @@ -23,7 +23,7 @@ block: - name: Apply role "{{ workload_loop_var }}" on nodes include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/{{ workload_loop_var }}" + name: "{{ workload_loop_var }}" vars: ACTION: "provision" loop: "{{ infra_workloads.split(',')|list }}" diff --git a/ansible/configs/linklight-foundations/README.adoc b/ansible/configs/linklight-foundations/README.adoc index 1b68f9f12fa..339f6e322c8 100644 --- a/ansible/configs/linklight-foundations/README.adoc +++ b/ansible/configs/linklight-foundations/README.adoc @@ -42,7 +42,7 @@ $ mydeploy-script.sh --student_workloads=linklight_engine --more_args ... [source,bash] ---- ansible-playbook main.yml \ - -e ANSIBLE_REPO_PATH=${ANSIBLE_REPO_PATH} \ + -e ANSIBLE_REPO_PATH | default('.')=${ANSIBLE_REPO_PATH | default('.')} \ -e guid=${GUID} \ ..... args omitted for brevity -e @configs/linklight/linklight_all_vars.yml \ @@ -114,10 +114,10 @@ STUDENT_WORKLOADS=foundations_engine #foundations_networking_v2_allcisco #foundations_tower -ANSIBLE_REPO_PATH=$(pwd) +ANSIBLE_REPO_PATH | default('.')=$(pwd) ansible-playbook main.yml \ - -e ANSIBLE_REPO_PATH=${ANSIBLE_REPO_PATH} \ + -e ANSIBLE_REPO_PATH | default('.')=${ANSIBLE_REPO_PATH | default('.')} \ -e guid=${GUID} \ -e env_type=${ENVTYPE} \ -e project_tag=${ENVTYPE}-${GUID} \ @@ -159,10 +159,10 @@ STUDENT_WORKLOADS=foundations_engine EC2_NAME_PREFIX=${GUID} EC2_REGION=us-east-1 -ANSIBLE_REPO_PATH=$(pwd) +ANSIBLE_REPO_PATH | default('.')=$(pwd) -ansible-playbook ${ANSIBLE_REPO_PATH}/configs/${ENV_TYPE}/destroy_env.yml \ - -e ANSIBLE_REPO_PATH=${ANSIBLE_REPO_PATH} \ +ansible-playbook ${ANSIBLE_REPO_PATH | default('.')}/configs/${ENV_TYPE}/destroy_env.yml \ + -e ANSIBLE_REPO_PATH | default('.')=${ANSIBLE_REPO_PATH | default('.')} \ -e ec2_name_prefix=${GUID} \ -e ec2_region=${EC2_REGION} \ -e @configs/${ENVTYPE}/lab_vars/foundations_all_vars.yml \ diff --git a/ansible/configs/linklight-foundations/destroy_env.yml b/ansible/configs/linklight-foundations/destroy_env.yml index c39370bcb7c..f8f083c0331 100644 --- a/ansible/configs/linklight-foundations/destroy_env.yml +++ b/ansible/configs/linklight-foundations/destroy_env.yml @@ -3,8 +3,8 @@ connection: local gather_facts: False become: no - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/workdir/linklight-foundations/provisioner/teardown_lab.yml" + + + +- import_playbook: "{{workdir_dir}}/linklight-foundations/provisioner/teardown_lab.yml" diff --git a/ansible/configs/linklight-foundations/post_infra.yml b/ansible/configs/linklight-foundations/post_infra.yml index 79266a58866..7dadff7703a 100644 --- a/ansible/configs/linklight-foundations/post_infra.yml +++ b/ansible/configs/linklight-foundations/post_infra.yml @@ -3,9 +3,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure @@ -44,9 +44,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -104,19 +104,19 @@ - name: Run infra-ec2-create-inventory Role include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-ec2-create-inventory" + name: "infra-ec2-create-inventory" - name: Run Common SSH Config Generator Role include_role: - name: "{{ANSIBLE_REPO_PATH}}/roles/infra-common-ssh-config-generate" + name: "infra-common-ssh-config-generate" - name: ssh workaround thing hosts: all connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure @@ -124,5 +124,5 @@ - name: set facts for remote access set_fact: - ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" + ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{workdir_dir}}/{{ env_type }}_{{ guid }}_ssh_conf" diff --git a/ansible/configs/linklight-foundations/post_software.yml b/ansible/configs/linklight-foundations/post_software.yml index 2b419864371..b168ad6d99d 100644 --- a/ansible/configs/linklight-foundations/post_software.yml +++ b/ansible/configs/linklight-foundations/post_software.yml @@ -2,8 +2,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - debug: msg: "Post-Software tasks Started" @@ -14,11 +14,11 @@ become: yes tags: - opentlc_bastion_tasks - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool # sssd bug, fixed by restart @@ -33,9 +33,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/linklight-foundations/pre_infra.yml b/ansible/configs/linklight-foundations/pre_infra.yml index 7ffd0d6968e..737552d1246 100644 --- a/ansible/configs/linklight-foundations/pre_infra.yml +++ b/ansible/configs/linklight-foundations/pre_infra.yml @@ -3,9 +3,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -18,19 +18,19 @@ - name: Generate SSH keys when set_env_authorized_key block: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{ env_authorized_key }}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" + creates: "{{workdir_dir}}/{{ env_authorized_key }}" - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" + path: "{{workdir_dir}}/{{ env_authorized_key }}" mode: 0400 - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{ env_authorized_key }}" > "{{workdir_dir}}/{{ env_authorized_key }}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}.pub" + creates: "{{workdir_dir}}/{{ env_authorized_key }}.pub" when: set_env_authorized_key - name: PreSoftware flight-check @@ -38,16 +38,16 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: - debug: msg: "Pre-Software checks completed successfully" -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/workdir/linklight-foundations/provisioner/provision_lab.yml" +- import_playbook: "{{workdir_dir}}/linklight-foundations/provisioner/provision_lab.yml" tags: - linklight_provision @@ -56,9 +56,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check diff --git a/ansible/configs/linklight-foundations/pre_software.yml b/ansible/configs/linklight-foundations/pre_software.yml index 1ac16bec2d3..a358b70d8cb 100644 --- a/ansible/configs/linklight-foundations/pre_software.yml +++ b/ansible/configs/linklight-foundations/pre_software.yml @@ -5,25 +5,25 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } + - { role: "bastion", when: 'install_bastion' } tags: - step004 - bastion_tasks @@ -34,9 +34,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/linklight/README.adoc b/ansible/configs/linklight/README.adoc index 032b0eabac7..bc0b806e432 100644 --- a/ansible/configs/linklight/README.adoc +++ b/ansible/configs/linklight/README.adoc @@ -42,7 +42,7 @@ $ mydeploy-script.sh --student_workloads=linklight_engine --more_args ... [source,bash] ---- ansible-playbook main.yml \ - -e ANSIBLE_REPO_PATH=${ANSIBLE_REPO_PATH} \ + -e ANSIBLE_REPO_PATH | default('.')=${ANSIBLE_REPO_PATH | default('.')} \ -e guid=${GUID} \ ..... args omitted for brevity -e @configs/linklight/linklight_all_vars.yml \ @@ -111,10 +111,10 @@ EC2_KEYNAME=${GUID}-link STUDENT_TOTAL=2 -ANSIBLE_REPO_PATH=$(pwd) +ANSIBLE_REPO_PATH | default('.')=$(pwd) ansible-playbook main.yml \ - -e ANSIBLE_REPO_PATH=${ANSIBLE_REPO_PATH} \ + -e ANSIBLE_REPO_PATH | default('.')=${ANSIBLE_REPO_PATH | default('.')} \ -e guid=${GUID} \ -e env_type=${ENV_TYPE} \ -e project_tag=${ENV_TYPE}-${GUID} \ @@ -155,10 +155,10 @@ ENV_TYPE=linklight EC2_NAME_PREFIX=${GUID} EC2_REGION=us-east-1 -ANSIBLE_REPO_PATH=$(pwd) +ANSIBLE_REPO_PATH | default('.')=$(pwd) -ansible-playbook ${ANSIBLE_REPO_PATH}/configs/${ENV_TYPE}/destroy_env.yml \ - -e ANSIBLE_REPO_PATH=${ANSIBLE_REPO_PATH} \ +ansible-playbook ${ANSIBLE_REPO_PATH | default('.')}/configs/${ENV_TYPE}/destroy_env.yml \ + -e ANSIBLE_REPO_PATH | default('.')=${ANSIBLE_REPO_PATH | default('.')} \ -e ec2_name_prefix=${GUID} \ -e ec2_region=${EC2_REGION} \ -e @configs/linklight/linklight_all_vars.yml \ diff --git a/ansible/configs/linklight/destroy_env.yml b/ansible/configs/linklight/destroy_env.yml index 45e8b7f3afe..8489463e5ea 100644 --- a/ansible/configs/linklight/destroy_env.yml +++ b/ansible/configs/linklight/destroy_env.yml @@ -3,8 +3,8 @@ connection: local gather_facts: False become: no - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/workdir/linklight/provisioner/teardown_lab.yml" + + + +- import_playbook: "{{workdir_dir}}/linklight/provisioner/teardown_lab.yml" diff --git a/ansible/configs/linklight/post_infra.yml b/ansible/configs/linklight/post_infra.yml index 79266a58866..eeac335d82a 100644 --- a/ansible/configs/linklight/post_infra.yml +++ b/ansible/configs/linklight/post_infra.yml @@ -3,9 +3,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure @@ -44,9 +44,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -104,19 +104,19 @@ - name: Run infra-ec2-create-inventory Role include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-ec2-create-inventory" + name: "infra-ec2-create-inventory" - name: Run Common SSH Config Generator Role include_role: - name: "{{ANSIBLE_REPO_PATH}}/roles/infra-common-ssh-config-generate" + name: "infra-common-ssh-config-generate" - name: ssh workaround thing hosts: all connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure @@ -124,5 +124,5 @@ - name: set facts for remote access set_fact: - ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" + ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{workdir_dir}}/{{ env_type }}_{{ guid }}_ssh_conf" diff --git a/ansible/configs/linklight/post_software.yml b/ansible/configs/linklight/post_software.yml index 2b419864371..ddaa7fc1aa7 100644 --- a/ansible/configs/linklight/post_software.yml +++ b/ansible/configs/linklight/post_software.yml @@ -2,8 +2,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - debug: msg: "Post-Software tasks Started" @@ -14,11 +14,11 @@ become: yes tags: - opentlc_bastion_tasks - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool # sssd bug, fixed by restart @@ -33,9 +33,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/linklight/pre_infra.yml b/ansible/configs/linklight/pre_infra.yml index ae847bd3d35..674d42ec970 100644 --- a/ansible/configs/linklight/pre_infra.yml +++ b/ansible/configs/linklight/pre_infra.yml @@ -3,9 +3,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -18,19 +18,19 @@ - name: Generate SSH keys when set_env_authorized_key block: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{ env_authorized_key }}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" + creates: "{{workdir_dir}}/{{ env_authorized_key }}" - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" + path: "{{workdir_dir}}/{{ env_authorized_key }}" mode: 0400 - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{ env_authorized_key }}" > "{{workdir_dir}}/{{ env_authorized_key }}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}.pub" + creates: "{{workdir_dir}}/{{ env_authorized_key }}.pub" when: set_env_authorized_key - name: PreSoftware flight-check @@ -38,16 +38,16 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: - debug: msg: "Pre-Software checks completed successfully" -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/workdir/linklight/provisioner/provision_lab.yml" +- import_playbook: "{{workdir_dir}}/linklight/provisioner/provision_lab.yml" tags: - linklight_provision @@ -56,31 +56,31 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: - - - name: generate email content for user + + - name: generate email content for user block: - name: generate user info string for email when a workshop, create_login_page set to true, S3 bucket debug: msg: "user.info: The list of VMs for this workshop is available at:" - - name: generate S3 bucket URL for user email when ec2_region is us-east-1 + - name: generate S3 bucket URL for user email when ec2_region is us-east-1 debug: - msg: "user.info: https://s3.amazonaws.com/{{ guid }}.{{ workshop_dns_zone }}/{{ guid }}-index.html" - when: ec2_region == 'us-east-1' + msg: "user.info: https://s3.amazonaws.com/{{ guid }}.{{ workshop_dns_zone }}/{{ guid }}-index.html" + when: ec2_region == 'us-east-1' - name: generate S3 bucket URL for user email when ec2_region is NOT us-east-1 debug: - msg: "user.info: https://s3-{{ ec2_region }}.amazonaws.com/{{ guid }}.{{ workshop_dns_zone }}/{{ guid }}-index.html" - when: ec2_region != 'us-east-1' + msg: "user.info: https://s3-{{ ec2_region }}.amazonaws.com/{{ guid }}.{{ workshop_dns_zone }}/{{ guid }}-index.html" + when: ec2_region != 'us-east-1' - when: create_login_page + when: create_login_page - debug: msg: "Post-Software checks completed successfully" diff --git a/ansible/configs/linklight/pre_software.yml b/ansible/configs/linklight/pre_software.yml index 1ac16bec2d3..0a7e8221c1b 100644 --- a/ansible/configs/linklight/pre_software.yml +++ b/ansible/configs/linklight/pre_software.yml @@ -5,25 +5,25 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } + - { role: "bastion", when: 'install_bastion' } tags: - step004 - bastion_tasks @@ -34,9 +34,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/ocp-clientvm/README.adoc b/ansible/configs/ocp-clientvm/README.adoc index 3803e64f982..fa23f22b184 100644 --- a/ansible/configs/ocp-clientvm/README.adoc +++ b/ansible/configs/ocp-clientvm/README.adoc @@ -40,17 +40,18 @@ You can run the playbook with the following arguments to overwrite the default v [source,bash] ---- -GUID=testclientvm1 -REGION=us-east-1 +GUID=sborenstest2 +REGION=ap-southeast-1 KEYNAME=ocpkey ENVTYPE="ocp-clientvm" CLOUDPROVIDER=ec2 -HOSTZONEID='Z186MFNM7DX4NF' +HOSTZONEID='Z3IHLWJZOU9SRT' REPO_PATH='https://admin.example.com/repos/ocp/3.9.14/' + BASESUFFIX='.example.opentlc.com' -REPO_VERSION=3.9 +REPO_VERSION=3.11 DEPLOYER_REPO_PATH=`pwd` -OSRELEASE=3.9.14 +OSRELEASE=3.11.16 ansible-playbook main.yml \ -e "guid=${GUID}" \ @@ -58,7 +59,7 @@ ansible-playbook main.yml \ -e "osrelease=${OSRELEASE}" \ -e "repo_version=${REPO_VERSION}" \ -e "docker_version=1.13.1" \ - -e "cloud_provider=${CLOUDPROVIDER}" + -e "cloud_provider=${CLOUDPROVIDER}" \ -e "aws_region=${REGION}" \ -e "HostedZoneId=${HOSTZONEID}" \ -e "key_name=${KEYNAME}" \ @@ -66,28 +67,25 @@ ansible-playbook main.yml \ -e "clientvm_instance_type=t2.large" \ -e "email=name@example.com" \ -e "software_to_deploy=none" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ - -e "own_repo_path=${REPO_PATH}" + -e "own_repo_path=${REPO_PATH}" -e"@../../secret.yml" + + + -e "ANSIBLE_REPO_PATH | default('.') | default('.')=${DEPLOYER_REPO_PATH}" \ ---- === Satellite version ---- -GUID=testclientvm1 -REGION=us-east-1 +GUID=sborenstest2 +REGION=ap-southeast-1 KEYNAME=ocpkey ENVTYPE="ocp-clientvm" CLOUDPROVIDER=ec2 HOSTZONEID='Z186MFNM7DX4NF' BASESUFFIX='.example.opentlc.com' -REPO_VERSION=3.9 +REPO_VERSION=3.11 DEPLOYER_REPO_PATH=`pwd` LOG_FILE=/tmp/${ENVTYPE}-${GUID}.log -IPAPASS=$5 - -if [ "$1" = "provision" ] ; then - -echo "Provisioning: ${STACK_NAME}" 1>> $LOG_FILE 2>> $LOG_FILE ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \ -e "guid=${GUID}" \ @@ -98,14 +96,14 @@ ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \ -e "HostedZoneId=${HOSTZONEID}" \ -e "subdomain_base_suffix=${BASESUFFIX}" \ -e "clientvm_instance_type=t2.large" \ - -e "ipa_host_password=${IPAPASS}" +# -e "ipa_host_password=${IPAPASS}" -e "repo_method=satellite" \ -e "repo_version=${REPO_VERSION}" \ -e "email=name@example.com" \ -e "software_to_deploy=none" \ - -e "osrelease=3.9.14" \ + -e "osrelease=3.11.16" \ -e "docker_version=1.13.1" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE + -e "ANSIBLE_REPO_PATH | default('.') | default('.')=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE ---- === To Delete an environment @@ -147,4 +145,4 @@ ENVTYPE_ARGS=( -e "clientvm_instance_type=t2.large" -e "subdomain_base_suffix=.example.opentlc.com" ) ----- \ No newline at end of file +---- diff --git a/ansible/configs/ocp-clientvm/env_vars.yml b/ansible/configs/ocp-clientvm/env_vars.yml index e22518c2817..f63cbc7f95a 100644 --- a/ansible/configs/ocp-clientvm/env_vars.yml +++ b/ansible/configs/ocp-clientvm/env_vars.yml @@ -1,6 +1,8 @@ ###### VARIABLES YOU SHOULD CONFIGURE FOR YOUR DEPLOYEMNT ###### OR PASS as "-e" args to ansible-playbook command + +workdir_dir: /opt/workdir ### Common Host settings repo_method: file # Other Options are: file, satellite and rhn # Do you want to run a full yum update @@ -21,7 +23,7 @@ install_bastion: true install_common: true install_opentlc_integration: true install_ipa_client: false -# Install a user id 'student'. If install_student_user=true then a global variable +# Install a user id 'student'. If install_student_user=true then a global variable # student_password=password needs to be provided with the password to set for the user student install_student_user: false @@ -32,7 +34,7 @@ install_student_user: false use_own_key: true env_authorized_key: "{{guid}}key" -ansible_ssh_private_key_file: ~/.ssh/{{key_name}}.pem +ansible_ssh_private_key_file: /opt/secret/{{key_name}}.pem set_env_authorized_key: true # Is this running from Red Hat Ansible Tower diff --git a/ansible/configs/ocp-clientvm/pre_software.yml b/ansible/configs/ocp-clientvm/pre_software.yml index 26207f2ff64..31a77739905 100644 --- a/ansible/configs/ocp-clientvm/pre_software.yml +++ b/ansible/configs/ocp-clientvm/pre_software.yml @@ -9,21 +9,21 @@ - generate_env_keys tasks: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{workdir_dir}}/{{env_authorized_key}}" when: set_env_authorized_key - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + path: "{{workdir_dir}}/{{env_authorized_key}}" mode: 0400 when: set_env_authorized_key - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}//{{env_authorized_key}}" > "{{workdir_dir}}/{{env_authorized_key}}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + creates: "{{workdir_dir}}/{{env_authorized_key}}.pub" when: set_env_authorized_key # Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} @@ -36,17 +36,17 @@ - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-student-user", when: 'install_student_user' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa", when: 'install_ipa_client' } + - { role: "bastion", when: 'install_bastion' } + - { role: "bastion-student-user", when: 'install_student_user' } + - { role: "bastion-opentlc-ipa", when: 'install_ipa_client' } tags: - step004 - bastion_tasks diff --git a/ansible/configs/ocp-clientvm/software.yml b/ansible/configs/ocp-clientvm/software.yml index 17a01bc209a..937807cc749 100644 --- a/ansible/configs/ocp-clientvm/software.yml +++ b/ansible/configs/ocp-clientvm/software.yml @@ -14,7 +14,7 @@ tasks: - name: Set up Client VM import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-client-vm" + name: "ocp-client-vm" - name: Software flight-check hosts: localhost diff --git a/ansible/configs/ocp-gpu-single-node/README.adoc b/ansible/configs/ocp-gpu-single-node/README.adoc index 893e6bef90f..038f2fe1099 100644 --- a/ansible/configs/ocp-gpu-single-node/README.adoc +++ b/ansible/configs/ocp-gpu-single-node/README.adoc @@ -43,7 +43,7 @@ zabbix_auto_registration_pass: "XXXXX" === Add new users on the bastion -For managing users on the bastion, you can override the `mgr_users` variable. The default is located in `{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/mgr_users.yml`, and looks like : +For managing users on the bastion, you can override the `mgr_users` variable. The default is located in `{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/mgr_users.yml`, and looks like : .Default mgr_users.yml [source,yaml] @@ -99,7 +99,7 @@ ansible-playbook main.yml -e "guid=${GUID}" -e "env_type=${ENVTYPE}" \ -e "nfs_instance_type=m3.large" -e "node_instance_count=5" \ -e "email=name@example.com" \ -e "install_idm=htpasswd" -e "software_to_deploy=openshift" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" -e "own_repo_path=${REPO_PATH}" --skip-tags=remove_self_provisioners + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" -e "own_repo_path=${REPO_PATH}" --skip-tags=remove_self_provisioners ---- @@ -134,7 +134,7 @@ ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \ -e "repo_method=satellite" -e "repo_version=${REPO_VERSION}" \ -e "email=name@example.com" \ -e "software_to_deploy=openshift" -e "osrelease=3.5.5.15" -e "docker_version=1.12.6" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE ---- === Advanced Development Workshop @@ -163,7 +163,7 @@ ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \ -e "nfs_instance_type=t2.large" -e "node_instance_count=${NODE_COUNT}" \ -e "install_idm=htpasswd" -e "software_to_deploy=openshift" \ -e "email=name@example.com" \ - -e "own_repo_path=${REPO_PATH}" -e"repo_method=file" -e"ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "own_repo_path=${REPO_PATH}" -e"repo_method=file" -e"ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "osrelease=${REPO_VERSION}" -e "repo_version=${REPO_VERSION}" -e "docker_version=1.12.6" \ -e install_lets_encrypt_certificates=false -e user_vols=100\ --skip-tags=remove_self_provisioners,opentlc-integration,install_zabbix @@ -203,7 +203,7 @@ REPO_VERSION=3.5 NODE_COUNT=4 NEW_NODE_COUNT=2 ansible-playbook ./configs/${ENVTYPE}/scaleup.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "HostedZoneId=${HOSTZONEID}" \ -e "bastion_instance_type=t2.large" \ -e "cloud_provider=${CLOUDPROVIDER}" \ @@ -239,7 +239,7 @@ CLOUDPROVIDER=ec2 HOSTZONEID='Z186MFNM7DX4NF' #To Destroy an Env ansible-playbook ./configs/${ENVTYPE}/destroy_env.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" -e "env_type=${ENVTYPE}" -e "cloud_provider=${CLOUDPROVIDER}" -e "aws_region=${REGION}" \ -e "HostedZoneId=${HOSTZONEID}" -e "key_name=${KEYNAME}" -e "subdomain_base_suffix=${BASESUFFIX}" ---- diff --git a/ansible/configs/ocp-gpu-single-node/destroy_env.yml b/ansible/configs/ocp-gpu-single-node/destroy_env.yml index 2d2c2de5639..f46ddb6981a 100644 --- a/ansible/configs/ocp-gpu-single-node/destroy_env.yml +++ b/ansible/configs/ocp-gpu-single-node/destroy_env.yml @@ -4,17 +4,17 @@ connection: local gather_facts: False become: no - vars_files: - - "{{ANSIBLE_REPO_PATH}}/configs/{{ env_type }}/env_vars.yml" - - "{{ANSIBLE_REPO_PATH}}/configs/{{ env_type }}/env_secret_vars.yml" + + + tasks: - name: Run infra-ec2-template-destroy include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-{{cloud_provider}}-template-destroy" + name: "infra-{{cloud_provider}}-template-destroy" when: cloud_provider == 'ec2' - name: Run infra-azure-template-destroy include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-{{cloud_provider}}-template-destroy" + name: "infra-{{cloud_provider}}-template-destroy" when: cloud_provider == 'azure' diff --git a/ansible/configs/ocp-gpu-single-node/env_tests.yml b/ansible/configs/ocp-gpu-single-node/env_tests.yml index 9ccce7adbc1..35c0c672874 100644 --- a/ansible/configs/ocp-gpu-single-node/env_tests.yml +++ b/ansible/configs/ocp-gpu-single-node/env_tests.yml @@ -3,7 +3,7 @@ - name: ocp-workshop tests hosts: masters[0] become: yes - vars_files: + - "./{{ env_type }}_vars.yml" - "./{{ env_type }}_secret_vars.yml" diff --git a/ansible/configs/ocp-gpu-single-node/exports.sh b/ansible/configs/ocp-gpu-single-node/exports.sh index cca18c57529..0a5b6626b64 100644 --- a/ansible/configs/ocp-gpu-single-node/exports.sh +++ b/ansible/configs/ocp-gpu-single-node/exports.sh @@ -12,5 +12,5 @@ ansible-playbook main.yml -e "guid=${GUID}" -e "env_type=${ENVTYPE}" \ -e "HostedZoneId=${HOSTZONEID}" -e "key_name=${KEYNAME}" \ -e "subdomain_base_suffix=${BASESUFFIX}" \ -e "software_to_deploy=openshift" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" --skip-tags=remove_self_provisioners \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" --skip-tags=remove_self_provisioners \ -t step000,step001 diff --git a/ansible/configs/ocp-gpu-single-node/post_infra.yml b/ansible/configs/ocp-gpu-single-node/post_infra.yml index 9e18f5de141..4eb168ffaf2 100644 --- a/ansible/configs/ocp-gpu-single-node/post_infra.yml +++ b/ansible/configs/ocp-gpu-single-node/post_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step002 - step002.1 @@ -42,7 +42,7 @@ - name: write down s3user credentials copy: - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.s3user.credentials" + dest: "{{workdir_dir}}/{{ env_type }}.{{ guid }}.s3user.credentials" content: | * S3 Bucket for registry: {{s3user}} ** S3User access key: {{s3user_access_key}} @@ -63,7 +63,7 @@ - name: write down Route53User credentials copy: - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.route53user.credentials" + dest: "{{workdir_dir}}/{{ env_type }}.{{ guid }}.route53user.credentials" content: | * Route53 User for Let's Encrypt: {{ route53user }} ** Route53User access key: {{ route53user_access_key }} @@ -79,9 +79,9 @@ hosts: support become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step002 - step002.2 @@ -282,9 +282,9 @@ hosts: nodes become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step002 - step002.3 @@ -351,9 +351,9 @@ hosts: infranodes become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step002 - step002.4 @@ -420,9 +420,9 @@ hosts: masters become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step002 - step002.5 diff --git a/ansible/configs/ocp-gpu-single-node/post_software.yml b/ansible/configs/ocp-gpu-single-node/post_software.yml index c0e57b1988c..679e3f23427 100644 --- a/ansible/configs/ocp-gpu-single-node/post_software.yml +++ b/ansible/configs/ocp-gpu-single-node/post_software.yml @@ -3,9 +3,9 @@ hosts: bastions become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step005.1 - gpu_install_config @@ -36,9 +36,9 @@ hosts: bastions become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step005.2 - gpu_preflight @@ -81,9 +81,9 @@ hosts: bastions become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step005.3 - user_admin @@ -96,8 +96,8 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - post_flight_check tasks: diff --git a/ansible/configs/ocp-gpu-single-node/pre_infra.yml b/ansible/configs/ocp-gpu-single-node/pre_infra.yml index ca0b1efaad3..e48c31df43d 100644 --- a/ansible/configs/ocp-gpu-single-node/pre_infra.yml +++ b/ansible/configs/ocp-gpu-single-node/pre_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" -# - "./env_secret_vars.yml" + + +# tags: - step000 - pre_infrastructure diff --git a/ansible/configs/ocp-gpu-single-node/pre_software.yml b/ansible/configs/ocp-gpu-single-node/pre_software.yml index a0aa10d8af5..4f0d4664015 100644 --- a/ansible/configs/ocp-gpu-single-node/pre_software.yml +++ b/ansible/configs/ocp-gpu-single-node/pre_software.yml @@ -4,16 +4,16 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step003 - step003.1 - generate_env_keys tasks: roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/infra-local-create-ssh_key" + - role: "infra-local-create-ssh_key" when: set_env_authorized_key is defined - name: Step 003.2 - Configure Repositories, Run common Role and Set SSH Key as authorised @@ -21,9 +21,9 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step003 - step003.2 @@ -47,22 +47,22 @@ - osrelease is version_compare('3.9', '>=') - osrelease is version_compare('3.11', '<') roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories" + - role: "set-repositories" when: repo_method is defined - - role: "{{ ANSIBLE_REPO_PATH }}/roles/common" + - role: "common" when: install_common|bool - - role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key" + - role: "set_env_authorized_key" when: set_env_authorized_key|bool - name: Configuring Bastion Hosts hosts: bastions become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } + - { role: "bastion", when: 'install_bastion' } tags: - step003 - bastion_tasks @@ -72,9 +72,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: @@ -87,12 +87,12 @@ # run_once: true # become: true # gather_facts: false -# vars_files: -# - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" +# +# # tasks: # - name: Create Let's Encrypt Certificates # include_role: -# name: "{{ ANSIBLE_REPO_PATH }}/roles/host-lets-encrypt-certs" +# name: "host-lets-encrypt-certs" # vars: # - acme_domain: "{{ master_lb_dns }}" # - acme_wildcard_domain: "*.{{ cloudapps_suffix }}" @@ -100,9 +100,9 @@ # - acme_aws_secret_access_key: "{{ hostvars['localhost'].route53user_secret_access_key }}" # - acme_production: "{{ lets_encrypt_production|d(False)|bool}}" # - acme_remote_dir: "/root" -# - acme_cache_cert_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}.cert" -# - acme_cache_key_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}.key" -# - acme_cache_archive_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}_acme.tgz" +# - acme_cache_cert_file: "{{workdir_dir}}/{{guid}}.cert" +# - acme_cache_key_file: "{{workdir_dir}}/{{guid}}.key" +# - acme_cache_archive_file: "{{workdir_dir}}/{{guid}}_acme.tgz" # - acme_renew_automatically: True # - acme_force_issue: False # when: diff --git a/ansible/configs/ocp-gpu-single-node/scaleup.yml b/ansible/configs/ocp-gpu-single-node/scaleup.yml index ba9cd54e0f6..f36edaf1d77 100644 --- a/ansible/configs/ocp-gpu-single-node/scaleup.yml +++ b/ansible/configs/ocp-gpu-single-node/scaleup.yml @@ -7,7 +7,7 @@ ################################################################################ ################################################################################ -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/pre_infra.yml" +- import_playbook: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/pre_infra.yml" tags: - step000 - pre_infra_tasks @@ -18,7 +18,7 @@ ################################################################################# ################################################################################# -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/cloud_providers/{{ cloud_provider }}_infrastructure_deployment.yml" +- import_playbook: "{{ ANSIBLE_REPO_PATH | default('.') }}/cloud_providers/{{ cloud_provider }}_infrastructure_deployment.yml" tags: - step001 - deploy_infrastructure @@ -28,8 +28,8 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Assert new_node_instance_count and node_instance_count are setup properly. tags: assert_new_node @@ -48,7 +48,7 @@ ################################################################################# ################################################################################# -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/post_infra.yml" +- import_playbook: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/post_infra.yml" tags: - step002 - post_infra_tasks @@ -66,16 +66,16 @@ - "newnodes" become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: PreSoftware flight-check @@ -83,9 +83,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: @@ -98,13 +98,13 @@ gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + hosts: - "newnodes" roles: - - "{{ ANSIBLE_REPO_PATH }}/roles/openshift-node" + - "openshift-node" tags: - openshift_node_tasks @@ -112,23 +112,23 @@ hosts: bastions become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - openshift_host_templates tasks: - - name: generate ansible hosts file, keep it under workdir + - name: generate ansible hosts file, keep it under workdir_dir template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/hosts_template.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/scaleup_hosts-{{ env_type }}-{{ guid }}" + src: "./files/hosts_template.j2" + dest: "{{workdir_dir}}/scaleup_hosts-{{ env_type }}-{{ guid }}" delegate_to: localhost become: false tags: - generate_ansible_hosts_file - name: Copy over ansible hosts file copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/scaleup_hosts-{{ env_type }}-{{ guid }}" + src: "{{workdir_dir}}/scaleup_hosts-{{ env_type }}-{{ guid }}" dest: /etc/ansible/scaleup_hosts ## Run Scaleup playbook @@ -137,8 +137,8 @@ gather_facts: False become: yes hosts: bastions[0] - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - installing_openshift ## Change to scale up, and change inventory file @@ -158,9 +158,9 @@ connection: local become: False gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - generate_ansible_hosts_file tasks: @@ -177,9 +177,9 @@ - name: Remove hosts from group newnodes gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + hosts: newnodes tasks: - group: @@ -191,9 +191,9 @@ hosts: bastions become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - openshift_host_templates tasks: @@ -201,10 +201,10 @@ msg: "WARNING: s3user credentials not set" when: s3user_access_key is not defined - - name: generate ansible hosts file, keep it under workdir + - name: generate ansible hosts file, keep it under workdir_dir template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/hosts_template.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ env_type }}-{{ guid }}" + src: "./files/hosts_template.j2" + dest: "{{workdir_dir}}/hosts-{{ env_type }}-{{ guid }}" delegate_to: localhost become: false tags: @@ -212,6 +212,6 @@ - name: Copy over ansible hosts file copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ project_tag }}" + src: "{{workdir_dir}}/hosts-{{ project_tag }}" dest: /etc/ansible/hosts backup: yes diff --git a/ansible/configs/ocp-ha-disconnected-lab/README.adoc b/ansible/configs/ocp-ha-disconnected-lab/README.adoc index 86a717e0500..4094ecbb744 100644 --- a/ansible/configs/ocp-ha-disconnected-lab/README.adoc +++ b/ansible/configs/ocp-ha-disconnected-lab/README.adoc @@ -83,7 +83,7 @@ LOG_FILE=$(pwd)/${ENVTYPE}-${GUID}.log -e "email=name@example.com" \ -e "repo_method=file" -e "own_repo_path=${REPO_PATH}" -e "repo_version=${REPO_VERSION}" \ -e "software_to_deploy=openshift" -e "osrelease=3.6.173.0.21" -e "docker_version=1.12.6" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ --skip-tags=installing_openshift,get_openshift_credentials 1>> $LOG_FILE 2>> $LOG_FILE . To Delete an environment @@ -93,7 +93,7 @@ ansible-playbook \ ${DEPLOYER_REPO_PATH}/configs/${ENVTYPE}/destroy_env.yml \ -e "guid=${GUID}" -e "env_type=${ENVTYPE}" \ -e "cloud_provider=${CLOUDPROVIDER}" -e "aws_region=${REGION}" -e "HostedZoneId=${HOSTZONEID}" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "key_name=${KEYNAME}" -e "subdomain_base_suffix=${BASESUFFIX}" ---- @@ -141,6 +141,6 @@ ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \ -e "email=name@example.com" \ -e "repo_method=file" -e "own_repo_path=${REPO_PATH}" -e "repo_version=${REPO_VERSION}" \ -e "software_to_deploy=openshift" -e "osrelease=3.6.173.0.21" -e "docker_version=1.12.6" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ --skip-tags=installing_openshift,get_openshift_credentials -vv ---- diff --git a/ansible/configs/ocp-ha-disconnected-lab/aws_test.yml b/ansible/configs/ocp-ha-disconnected-lab/aws_test.yml index 3a10ed7eb54..b73ce5f8101 100644 --- a/ansible/configs/ocp-ha-disconnected-lab/aws_test.yml +++ b/ansible/configs/ocp-ha-disconnected-lab/aws_test.yml @@ -2,8 +2,6 @@ connection: local gather_facts: false become: false - vars_files: - - ./env_vars.yml tasks: - name: AWS Generate Cloudformation Template template: diff --git a/ansible/configs/ocp-ha-disconnected-lab/destroy_env.yml b/ansible/configs/ocp-ha-disconnected-lab/destroy_env.yml index 1dd6f1a8b43..a0a70510ee8 100644 --- a/ansible/configs/ocp-ha-disconnected-lab/destroy_env.yml +++ b/ansible/configs/ocp-ha-disconnected-lab/destroy_env.yml @@ -3,9 +3,9 @@ connection: local gather_facts: False become: no - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tasks: - name: Destroy cloudformation template diff --git a/ansible/configs/ocp-ha-disconnected-lab/post_infra.yml b/ansible/configs/ocp-ha-disconnected-lab/post_infra.yml index 6dce6081ad5..b978636e0be 100644 --- a/ansible/configs/ocp-ha-disconnected-lab/post_infra.yml +++ b/ansible/configs/ocp-ha-disconnected-lab/post_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step002 - post_infrastructure diff --git a/ansible/configs/ocp-ha-disconnected-lab/post_ocp_nfs_config.yml b/ansible/configs/ocp-ha-disconnected-lab/post_ocp_nfs_config.yml index 2829ecf4a58..21a2a27bdee 100644 --- a/ansible/configs/ocp-ha-disconnected-lab/post_ocp_nfs_config.yml +++ b/ansible/configs/ocp-ha-disconnected-lab/post_ocp_nfs_config.yml @@ -2,8 +2,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Create user vols shell: "mkdir -p /srv/nfs/user-vols/vol{1..{{user_vols}}}" @@ -14,8 +14,8 @@ hosts: bastions gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: get nfs Hostname set_fact: @@ -28,7 +28,7 @@ - name: Generate PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/pvs.j2" + src: "./files/pvs.j2" dest: "/root/pvs-{{ env_type }}-{{ guid }}.yml" tags: [ gen_pv_file ] when: pv_list.0 is defined @@ -42,7 +42,7 @@ - name: Generate user vol PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/userpvs.j2" + src: "./files/userpvs.j2" dest: "/root/userpvs-{{ env_type }}-{{ guid }}.yml" tags: - gen_user_vol_pv diff --git a/ansible/configs/ocp-ha-disconnected-lab/post_software.yml b/ansible/configs/ocp-ha-disconnected-lab/post_software.yml index 35a5ef44a96..5cec9ca76d0 100644 --- a/ansible/configs/ocp-ha-disconnected-lab/post_software.yml +++ b/ansible/configs/ocp-ha-disconnected-lab/post_software.yml @@ -4,33 +4,33 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step005 tasks: - name: Generate /etc/ansible/hosts file with lab inv template template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/labs_hosts_template.{{ osrelease }}.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" + src: "./files/labs_hosts_template.{{ osrelease }}.j2" + dest: "{{workdir_dir}}/labs_hosts-{{ env_type }}-{{ guid }}" - name: Run openshift host provision on the bastion gather_facts: False become: yes hosts: - bastions - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/host-ocp-provisioner" + - role: "host-ocp-provisioner" - name: Configure NFS host for user-vols if required hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Create user vols shell: "mkdir -p /srv/nfs/user-vols/vol{1..{{user_vols}}}" @@ -47,24 +47,24 @@ become: yes tags: - opentlc_bastion_tasks - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Copy complete inventory file to bastion /var/preserve/hosts copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ env_type }}-{{ guid }}" + src: "{{workdir_dir}}/hosts-{{ env_type }}-{{ guid }}" dest: /var/preserve/hosts tags: preserve_complete_ansible_inventory - name: copy prometheus rules file to bastion copy: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/prometheus_alerts_rules.yml" + src: "./files/prometheus_alerts_rules.yml" dest: /root/prometheus_alerts_rules.yml - name: Copy over ansible hosts file, lab version copy: backup: no - src: "{{ ANSIBLE_REPO_PATH }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" + src: "{{workdir_dir}}/labs_hosts-{{ env_type }}-{{ guid }}" dest: /etc/ansible/hosts tags: - overwrite_hosts_with_lab_hosts @@ -89,7 +89,7 @@ - openshift_nfs_config - name: Generate PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/pvs.j2" + src: "./files/pvs.j2" dest: "/root/pvs-{{ env_type }}-{{ guid }}.yml" when: pv_list.0 is defined tags: @@ -105,7 +105,7 @@ - name: Generate user vol PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/userpvs.j2" + src: "./files/userpvs.j2" dest: "/root/userpvs-{{ env_type }}-{{ guid }}.yml" tags: - gen_user_vol_pv @@ -123,7 +123,7 @@ - openshift_nfs_config - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool - name: PostSoftware flight-check @@ -131,9 +131,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/ocp-ha-disconnected-lab/pre_infra.yml b/ansible/configs/ocp-ha-disconnected-lab/pre_infra.yml index ee24d70ac7f..0234661055e 100644 --- a/ansible/configs/ocp-ha-disconnected-lab/pre_infra.yml +++ b/ansible/configs/ocp-ha-disconnected-lab/pre_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step000 - pre_infrastructure diff --git a/ansible/configs/ocp-ha-disconnected-lab/pre_software.yml b/ansible/configs/ocp-ha-disconnected-lab/pre_software.yml index 1a19e954a99..f958da52fb4 100644 --- a/ansible/configs/ocp-ha-disconnected-lab/pre_software.yml +++ b/ansible/configs/ocp-ha-disconnected-lab/pre_software.yml @@ -4,29 +4,29 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step003 - generate_env_keys tasks: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{workdir_dir}}/{{env_authorized_key}}" when: set_env_authorized_key - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + path: "{{workdir_dir}}/{{env_authorized_key}}" mode: 0400 when: set_env_authorized_key - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{env_authorized_key}}" > "{{workdir_dir}}/{{env_authorized_key}}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + creates: "{{workdir_dir}}/{{env_authorized_key}}.pub" when: set_env_authorized_key # Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} @@ -35,9 +35,9 @@ hosts: isolated become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks @@ -45,33 +45,33 @@ proxyservername: "http://{{ own_repo_path | urlsplit('hostname') }}" servername: "{{hostvars[groups['isolated'][0]].internaldns}}" roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/host-httpd-reverse-proxy", when: 'reverse_proxy is defined' } + - { role: "host-httpd-reverse-proxy", when: 'reverse_proxy is defined' } - name: Configure all hosts with Repositories, Common Files and Set environment key hosts: all become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } - # - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa", when: 'install_ipa_client' } + - { role: "bastion", when: 'install_bastion' } + # - { role: "bastion-opentlc-ipa", when: 'install_ipa_client' } tags: - step004 - bastion_tasks @@ -82,9 +82,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/ocp-ha-lab/README.adoc b/ansible/configs/ocp-ha-lab/README.adoc index 2ccf6032552..e175ca55431 100644 --- a/ansible/configs/ocp-ha-lab/README.adoc +++ b/ansible/configs/ocp-ha-lab/README.adoc @@ -83,7 +83,7 @@ LOG_FILE=$(pwd)/${ENVTYPE}-${GUID}.log -e "email=name@example.com" \ -e "repo_method=file" -e "own_repo_path=${REPO_PATH}" -e "repo_version=${REPO_VERSION}" \ -e "software_to_deploy=openshift" -e "osrelease=3.6.173.0.21" -e "docker_version=1.12.6" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ --skip-tags=installing_openshift,get_openshift_credentials 1>> $LOG_FILE 2>> $LOG_FILE . To Delete an environment @@ -93,7 +93,7 @@ ansible-playbook \ ${DEPLOYER_REPO_PATH}/configs/${ENVTYPE}/destroy_env.yml \ -e "guid=${GUID}" -e "env_type=${ENVTYPE}" \ -e "cloud_provider=${CLOUDPROVIDER}" -e "aws_region=${REGION}" -e "HostedZoneId=${HOSTZONEID}" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "key_name=${KEYNAME}" -e "subdomain_base_suffix=${BASESUFFIX}" ---- diff --git a/ansible/configs/ocp-ha-lab/post_ocp_nfs_config.yml b/ansible/configs/ocp-ha-lab/post_ocp_nfs_config.yml index 09c0094b12f..63d80b0fdee 100644 --- a/ansible/configs/ocp-ha-lab/post_ocp_nfs_config.yml +++ b/ansible/configs/ocp-ha-lab/post_ocp_nfs_config.yml @@ -24,7 +24,7 @@ - name: Generate PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/pvs.j2" + src: "./files/pvs.j2" dest: "/root/pvs-{{ env_type }}-{{ guid }}.yml" tags: [ gen_pv_file ] when: pv_list.0 is defined @@ -38,7 +38,7 @@ - name: Generate user vol PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/userpvs.j2" + src: "./files/userpvs.j2" dest: "/root/userpvs-{{ env_type }}-{{ guid }}.yml" tags: - gen_user_vol_pv diff --git a/ansible/configs/ocp-ha-lab/post_software.yml b/ansible/configs/ocp-ha-lab/post_software.yml index 36bc8078232..e676e62b806 100644 --- a/ansible/configs/ocp-ha-lab/post_software.yml +++ b/ansible/configs/ocp-ha-lab/post_software.yml @@ -9,12 +9,12 @@ tasks: - name: Generate /etc/ansible/hosts file with lab inv template template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/labs_hosts_template.{{ osrelease }}.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" + src: "./files/labs_hosts_template.{{ osrelease }}.j2" + dest: "{{workdir_dir}}/labs_hosts-{{ env_type }}-{{ guid }}" - name: Generate /etc/ansible/hosts file with homework8 inv template template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/hosts_homework8_template.{{ osrelease }}.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts_homework8-{{ env_type }}-{{ guid }}" + src: "./files/hosts_homework8_template.{{ osrelease }}.j2" + dest: "{{workdir_dir}}/hosts_homework8-{{ env_type }}-{{ guid }}" - name: Run openshift host provision on the bastion gather_facts: False @@ -22,7 +22,7 @@ hosts: - bastions roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/host-ocp-provisioner" + - role: "host-ocp-provisioner" - name: Configure NFS host for user-vols if required hosts: support @@ -47,19 +47,19 @@ tasks: - name: Copy complete inventory file to bastion /var/preserve/hosts copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ env_type }}-{{ guid }}" + src: "{{workdir_dir}}/hosts-{{ env_type }}-{{ guid }}" dest: /var/preserve/hosts tags: preserve_complete_ansible_inventory - name: copy prometheus rules file to bastion copy: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/prometheus_alerts_rules.yml" + src: "./files/prometheus_alerts_rules.yml" dest: /root/prometheus_alerts_rules.yml - name: Copy over homework8 hosts file, lab version copy: backup: no - src: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts_homework8-{{ env_type }}-{{ guid }}" + src: "{{workdir_dir}}/hosts_homework8-{{ env_type }}-{{ guid }}" dest: /etc/ansible/hosts tags: - overwrite_hosts_with_hosts_homework8 @@ -67,7 +67,7 @@ - name: Copy over ansible hosts file, lab version copy: backup: no - src: "{{ ANSIBLE_REPO_PATH }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" + src: "{{workdir_dir}}/labs_hosts-{{ env_type }}-{{ guid }}" dest: /etc/ansible/hosts tags: - overwrite_hosts_with_lab_hosts @@ -86,7 +86,7 @@ - openshift_nfs_config - name: Generate PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/pvs.j2" + src: "./files/pvs.j2" dest: "/root/pvs-{{ env_type }}-{{ guid }}.yml" when: pv_list.0 is defined tags: @@ -102,7 +102,7 @@ - name: Generate user vol PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/userpvs.j2" + src: "./files/userpvs.j2" dest: "/root/userpvs-{{ env_type }}-{{ guid }}.yml" tags: - gen_user_vol_pv @@ -120,7 +120,7 @@ - openshift_nfs_config - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool - name: Step dev tools diff --git a/ansible/configs/ocp-ha-lab/pre_software.yml b/ansible/configs/ocp-ha-lab/pre_software.yml index 1422127d73e..7c1efd4de40 100644 --- a/ansible/configs/ocp-ha-lab/pre_software.yml +++ b/ansible/configs/ocp-ha-lab/pre_software.yml @@ -10,21 +10,21 @@ - generate_env_keys tasks: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{workdir_dir}}/{{env_authorized_key}}" when: set_env_authorized_key - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + path: "{{workdir_dir}}/{{env_authorized_key}}" mode: 0400 when: set_env_authorized_key - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{env_authorized_key}}" > "{{workdir_dir}}/{{env_authorized_key}}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + creates: "{{workdir_dir}}/{{env_authorized_key}}.pub" when: set_env_authorized_key # Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} @@ -56,11 +56,11 @@ - osrelease is version_compare('3.9', '>=') - osrelease is version_compare('3.11', 'lt') roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories" + - role: "set-repositories" when: repo_method is defined - - role: "{{ ANSIBLE_REPO_PATH }}/roles/common" + - role: "common" when: install_common|bool - - role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key" + - role: "set_env_authorized_key" when: set_env_authorized_key|bool - name: Configuring Bastion Hosts @@ -68,7 +68,7 @@ become: true gather_facts: false roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } + - { role: "bastion", when: 'install_bastion' } tags: - step004 - bastion_tasks diff --git a/ansible/configs/ocp-implementation-lab/README.adoc b/ansible/configs/ocp-implementation-lab/README.adoc index 2ccf6032552..e175ca55431 100644 --- a/ansible/configs/ocp-implementation-lab/README.adoc +++ b/ansible/configs/ocp-implementation-lab/README.adoc @@ -83,7 +83,7 @@ LOG_FILE=$(pwd)/${ENVTYPE}-${GUID}.log -e "email=name@example.com" \ -e "repo_method=file" -e "own_repo_path=${REPO_PATH}" -e "repo_version=${REPO_VERSION}" \ -e "software_to_deploy=openshift" -e "osrelease=3.6.173.0.21" -e "docker_version=1.12.6" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ --skip-tags=installing_openshift,get_openshift_credentials 1>> $LOG_FILE 2>> $LOG_FILE . To Delete an environment @@ -93,7 +93,7 @@ ansible-playbook \ ${DEPLOYER_REPO_PATH}/configs/${ENVTYPE}/destroy_env.yml \ -e "guid=${GUID}" -e "env_type=${ENVTYPE}" \ -e "cloud_provider=${CLOUDPROVIDER}" -e "aws_region=${REGION}" -e "HostedZoneId=${HOSTZONEID}" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "key_name=${KEYNAME}" -e "subdomain_base_suffix=${BASESUFFIX}" ---- diff --git a/ansible/configs/ocp-implementation-lab/destroy_env.yml b/ansible/configs/ocp-implementation-lab/destroy_env.yml index 1dd6f1a8b43..432e278fe64 100644 --- a/ansible/configs/ocp-implementation-lab/destroy_env.yml +++ b/ansible/configs/ocp-implementation-lab/destroy_env.yml @@ -3,9 +3,9 @@ connection: local gather_facts: False become: no - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tasks: - name: Destroy cloudformation template diff --git a/ansible/configs/ocp-implementation-lab/post_infra.yml b/ansible/configs/ocp-implementation-lab/post_infra.yml index 2bf99e4d544..161dce95938 100644 --- a/ansible/configs/ocp-implementation-lab/post_infra.yml +++ b/ansible/configs/ocp-implementation-lab/post_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure diff --git a/ansible/configs/ocp-implementation-lab/post_ocp_nfs_config.yml b/ansible/configs/ocp-implementation-lab/post_ocp_nfs_config.yml index 2829ecf4a58..854b77d3eb7 100644 --- a/ansible/configs/ocp-implementation-lab/post_ocp_nfs_config.yml +++ b/ansible/configs/ocp-implementation-lab/post_ocp_nfs_config.yml @@ -2,8 +2,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Create user vols shell: "mkdir -p /srv/nfs/user-vols/vol{1..{{user_vols}}}" @@ -14,8 +14,8 @@ hosts: bastions gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: get nfs Hostname set_fact: @@ -28,7 +28,7 @@ - name: Generate PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/pvs.j2" + src: "./files/pvs.j2" dest: "/root/pvs-{{ env_type }}-{{ guid }}.yml" tags: [ gen_pv_file ] when: pv_list.0 is defined @@ -42,7 +42,7 @@ - name: Generate user vol PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/userpvs.j2" + src: "./files/userpvs.j2" dest: "/root/userpvs-{{ env_type }}-{{ guid }}.yml" tags: - gen_user_vol_pv diff --git a/ansible/configs/ocp-implementation-lab/post_software.yml b/ansible/configs/ocp-implementation-lab/post_software.yml index f4dca84aaca..eb625be9d63 100644 --- a/ansible/configs/ocp-implementation-lab/post_software.yml +++ b/ansible/configs/ocp-implementation-lab/post_software.yml @@ -4,23 +4,23 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step005 tasks: - name: Generate /etc/ansible/hosts file with lab hosts template template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/labs_hosts_template.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" + src: "./files/labs_hosts_template.j2" + dest: "{{workdir_dir}}/labs_hosts-{{ env_type }}-{{ guid }}" - name: Configure NFS host for user-vols if required hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Create user vols shell: "mkdir -p /srv/nfs/user-vols/vol{1..{{user_vols}}}" @@ -37,8 +37,8 @@ become: yes tags: - opentlc_bastion_tasks - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Move complete inventory file to preserve directory. shell: mv /etc/ansible/hosts /var/preserve/ @@ -47,7 +47,7 @@ - name: Copy over ansible hosts file, lab version copy: backup: no - src: "{{ ANSIBLE_REPO_PATH }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" + src: "{{workdir_dir}}/labs_hosts-{{ env_type }}-{{ guid }}" dest: /etc/ansible/hosts tags: - overwrite_hosts_with_lab_hosts @@ -66,7 +66,7 @@ - openshift_nfs_config - name: Generate PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/pvs.j2" + src: "./files/pvs.j2" dest: "/root/pvs-{{ env_type }}-{{ guid }}.yml" tags: [ gen_pv_file ] when: pv_list.0 is defined @@ -82,7 +82,7 @@ - name: Generate user vol PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/userpvs.j2" + src: "./files/userpvs.j2" dest: "/root/userpvs-{{ env_type }}-{{ guid }}.yml" tags: - gen_user_vol_pv @@ -101,7 +101,7 @@ - openshift_nfs_config - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool - name: PostSoftware flight-check @@ -109,9 +109,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/ocp-implementation-lab/pre_infra.yml b/ansible/configs/ocp-implementation-lab/pre_infra.yml index ee24d70ac7f..06a77c18bf6 100644 --- a/ansible/configs/ocp-implementation-lab/pre_infra.yml +++ b/ansible/configs/ocp-implementation-lab/pre_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step000 - pre_infrastructure diff --git a/ansible/configs/ocp-implementation-lab/pre_software.yml b/ansible/configs/ocp-implementation-lab/pre_software.yml index 77ab9933a72..ae21b1d985a 100644 --- a/ansible/configs/ocp-implementation-lab/pre_software.yml +++ b/ansible/configs/ocp-implementation-lab/pre_software.yml @@ -4,29 +4,29 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step003 - generate_env_keys tasks: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{workdir_dir}}/{{env_authorized_key}}" when: set_env_authorized_key - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + path: "{{workdir_dir}}/{{env_authorized_key}}" mode: 0400 when: set_env_authorized_key - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{env_authorized_key}}" > "{{workdir_dir}}/{{env_authorized_key}}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + creates: "{{workdir_dir}}/{{env_authorized_key}}.pub" when: set_env_authorized_key # Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} @@ -35,25 +35,25 @@ hosts: all become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } + - { role: "bastion", when: 'install_bastion' } tags: - step004 - bastion_tasks @@ -64,9 +64,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/ocp-multi-cloud-example/README.adoc b/ansible/configs/ocp-multi-cloud-example/README.adoc index 1c6cc90b8f7..db5d8e9168b 100644 --- a/ansible/configs/ocp-multi-cloud-example/README.adoc +++ b/ansible/configs/ocp-multi-cloud-example/README.adoc @@ -43,7 +43,7 @@ zabbix_auto_registration_pass: "XXXXX" === Add new users on the bastion -For managing users on the bastion, you can override the `mgr_users` variable. The default is located in `{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/mgr_users.yml`, and looks like : +For managing users on the bastion, you can override the `mgr_users` variable. The default is located in `{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/mgr_users.yml`, and looks like : .Default mgr_users.yml [source,yaml] @@ -100,7 +100,7 @@ ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \ -e "nfs_instance_type=t2.large" -e "node_instance_count=${NODE_COUNT}" \ -e "install_idm=htpasswd" -e "software_to_deploy=openshift" \ -e "email=sborenst@redhat.com" \ - -e "own_repo_path=${REPO_PATH}" -e"repo_method=file" -e"ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "own_repo_path=${REPO_PATH}" -e"repo_method=file" -e"ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "osrelease=${REPO_VERSION}" -e "repo_version=${REPO_VERSION}" -e "docker_version=1.13.1" \ -e install_lets_encrypt_certificates=false -e user_vols=100\ --tags=step000,step001,step002,step003 @@ -116,7 +116,7 @@ CLOUDPROVIDER=ec2 HOSTZONEID='Z186MFNM7DX4NF' #To Destroy an Env ansible-playbook ./configs/${ENVTYPE}/destroy_env.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" -e "env_type=${ENVTYPE}" -e "cloud_provider=${CLOUDPROVIDER}" -e "aws_region=${REGION}" \ -e "HostedZoneId=${HOSTZONEID}" -e "key_name=${KEYNAME}" -e "subdomain_base_suffix=${BASESUFFIX}" ---- diff --git a/ansible/configs/ocp-multi-cloud-example/destroy_env.yml b/ansible/configs/ocp-multi-cloud-example/destroy_env.yml index 2d2c2de5639..2c57291b6dd 100644 --- a/ansible/configs/ocp-multi-cloud-example/destroy_env.yml +++ b/ansible/configs/ocp-multi-cloud-example/destroy_env.yml @@ -4,17 +4,17 @@ connection: local gather_facts: False become: no - vars_files: - - "{{ANSIBLE_REPO_PATH}}/configs/{{ env_type }}/env_vars.yml" - - "{{ANSIBLE_REPO_PATH}}/configs/{{ env_type }}/env_secret_vars.yml" + + + tasks: - name: Run infra-ec2-template-destroy include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-{{cloud_provider}}-template-destroy" + name: "infra-{{cloud_provider}}-template-destroy" when: cloud_provider == 'ec2' - name: Run infra-azure-template-destroy include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-{{cloud_provider}}-template-destroy" + name: "infra-{{cloud_provider}}-template-destroy" when: cloud_provider == 'azure' diff --git a/ansible/configs/ocp-multi-cloud-example/env_tests.yml b/ansible/configs/ocp-multi-cloud-example/env_tests.yml index 9ccce7adbc1..798b77c833a 100644 --- a/ansible/configs/ocp-multi-cloud-example/env_tests.yml +++ b/ansible/configs/ocp-multi-cloud-example/env_tests.yml @@ -3,7 +3,7 @@ - name: ocp-workshop tests hosts: masters[0] become: yes - vars_files: + - "./{{ env_type }}_vars.yml" - "./{{ env_type }}_secret_vars.yml" diff --git a/ansible/configs/ocp-multi-cloud-example/packer.adoc b/ansible/configs/ocp-multi-cloud-example/packer.adoc index 4d4122a480e..cc5792288cb 100644 --- a/ansible/configs/ocp-multi-cloud-example/packer.adoc +++ b/ansible/configs/ocp-multi-cloud-example/packer.adoc @@ -5,7 +5,7 @@ You will find a packer file `packer.json`. To create the image for a specific version: ---- -packer build -var-file=~/secrets/rhte.json -var "ANSIBLE_REPO_PATH=$(pwd)/../../" -var own_repo_path=http://... packer.json +packer build -var-file=~/secrets/rhte.json -var "ANSIBLE_REPO_PATH | default('.')=$(pwd)/../../" -var own_repo_path=http://... packer.json ---- diff --git a/ansible/configs/ocp-multi-cloud-example/packer.json b/ansible/configs/ocp-multi-cloud-example/packer.json index 35f05252836..d6505f87db5 100644 --- a/ansible/configs/ocp-multi-cloud-example/packer.json +++ b/ansible/configs/ocp-multi-cloud-example/packer.json @@ -19,7 +19,7 @@ "playbook_file": "./pre_software.yml", "user": "ec2-user", "extra_arguments": [ - "--extra-vars", "ANSIBLE_REPO_PATH={{user `ANSIBLE_REPO_PATH`}}", + "--extra-vars", "ANSIBLE_REPO_PATH | default('.')={{user `ANSIBLE_REPO_PATH | default('.')`}}", "--extra-vars", "own_repo_path={{user `own_repo_path`}}", "--extra-vars", "env_type=ocp-multi-cloud-example", "--tags", "packer" diff --git a/ansible/configs/ocp-multi-cloud-example/post_infra.yml b/ansible/configs/ocp-multi-cloud-example/post_infra.yml index 8ee0243b99a..abbb99dc395 100644 --- a/ansible/configs/ocp-multi-cloud-example/post_infra.yml +++ b/ansible/configs/ocp-multi-cloud-example/post_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step002 - post_infrastructure @@ -43,7 +43,7 @@ # # - name: write down s3user credentials # copy: -# dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.s3user.credentials" +# dest: "{{workdir_dir}}/{{ env_type }}.{{ guid }}.s3user.credentials" # content: | # * S3 Bucket for registry: {{s3user}} # ** S3User access key: {{s3user_access_key}} @@ -64,7 +64,7 @@ # # - name: write down Route53User credentials # copy: -# dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.route53user.credentials" +# dest: "{{workdir_dir}}/{{ env_type }}.{{ guid }}.route53user.credentials" # content: | # * Route53 User for Let's Encrypt: {{ route53user }} # ** Route53User access key: {{ route53user_access_key }} @@ -76,9 +76,9 @@ # hosts: support # become: true # gather_facts: false -# vars_files: -# - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" -# - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" +# +# +# # tasks: # - name: test if docker_device file is present (previous run) # stat: @@ -275,9 +275,9 @@ # hosts: nodes # become: true # gather_facts: false -# vars_files: -# - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" -# - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" +# +# +# # tasks: # - name: test if docker_device file is present (previous run) # stat: @@ -340,9 +340,9 @@ # hosts: infranodes # become: true # gather_facts: false -# vars_files: -# - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" -# - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" +# +# +# # tasks: # - name: test if docker_device file is present (previous run) # stat: @@ -405,9 +405,9 @@ # hosts: masters # become: true # gather_facts: false -# vars_files: -# - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" -# - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" +# +# +# # tasks: # - name: test if docker_device file is present (previous run) # stat: diff --git a/ansible/configs/ocp-multi-cloud-example/post_software.yml b/ansible/configs/ocp-multi-cloud-example/post_software.yml index ddadf403b65..9a421d75417 100644 --- a/ansible/configs/ocp-multi-cloud-example/post_software.yml +++ b/ansible/configs/ocp-multi-cloud-example/post_software.yml @@ -3,8 +3,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Create user vols shell: "mkdir -p /srv/nfs/user-vols/vol{1..{{user_vols}}}" diff --git a/ansible/configs/ocp-multi-cloud-example/pre_infra.yml b/ansible/configs/ocp-multi-cloud-example/pre_infra.yml index e5ae1074851..53ce3fe03ce 100644 --- a/ansible/configs/ocp-multi-cloud-example/pre_infra.yml +++ b/ansible/configs/ocp-multi-cloud-example/pre_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" -# - "./env_secret_vars.yml" + + +# tags: - step001 - pre_infrastructure diff --git a/ansible/configs/ocp-multi-cloud-example/pre_software.yml b/ansible/configs/ocp-multi-cloud-example/pre_software.yml index 7eaa345e9d6..34f6630b1d1 100644 --- a/ansible/configs/ocp-multi-cloud-example/pre_software.yml +++ b/ansible/configs/ocp-multi-cloud-example/pre_software.yml @@ -4,16 +4,16 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - step004.1 - generate_env_keys tasks: roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/infra-local-create-ssh_key" + - role: "infra-local-create-ssh_key" when: set_env_authorized_key is defined - name: Step 004.2 - Configure Repositories, Run common Role and Set SSH Key as authorised @@ -21,20 +21,20 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - step004.2 - common_tasks - packer roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories" + - role: "set-repositories" when: repo_method is defined - - role: "{{ ANSIBLE_REPO_PATH }}/roles/common" + - role: "common" when: install_common|bool - - role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key" + - role: "set_env_authorized_key" when: set_env_authorized_key|bool - name: Configuring Bastion Hosts @@ -43,12 +43,12 @@ - provisioners become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: install_bastion|bool } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-student-user", when: student_password is defined } + - { role: "bastion", when: install_bastion|bool } + - { role: "bastion-student-user", when: student_password is defined } tags: - step004 - bastion_tasks @@ -61,9 +61,9 @@ - default become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - packer tasks: @@ -82,9 +82,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/ocp-multi-cloud-example/scaleup.yml b/ansible/configs/ocp-multi-cloud-example/scaleup.yml index 43fab135d3f..1c3ebf59405 100644 --- a/ansible/configs/ocp-multi-cloud-example/scaleup.yml +++ b/ansible/configs/ocp-multi-cloud-example/scaleup.yml @@ -7,7 +7,7 @@ ################################################################################ ################################################################################ -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/pre_infra.yml" +- import_playbook: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/pre_infra.yml" tags: - step000 - pre_infra_tasks @@ -18,7 +18,7 @@ ################################################################################# ################################################################################# -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/cloud_providers/{{ cloud_provider }}_infrastructure_deployment.yml" +- import_playbook: "{{ ANSIBLE_REPO_PATH | default('.') }}/cloud_providers/{{ cloud_provider }}_infrastructure_deployment.yml" tags: - step001 - deploy_infrastructure @@ -28,8 +28,8 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Assert new_node_instance_count and node_instance_count are setup properly. tags: assert_new_node @@ -48,7 +48,7 @@ ################################################################################# ################################################################################# -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/post_infra.yml" +- import_playbook: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/post_infra.yml" tags: - step002 - post_infra_tasks @@ -66,16 +66,16 @@ - "newnodes" become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: PreSoftware flight-check @@ -83,9 +83,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: @@ -98,13 +98,13 @@ gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + hosts: - "newnodes" roles: - - "{{ ANSIBLE_REPO_PATH }}/roles/openshift-node" + - "openshift-node" tags: - openshift_node_tasks @@ -112,23 +112,23 @@ hosts: bastions become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - openshift_host_templates tasks: - - name: generate ansible hosts file, keep it under workdir + - name: generate ansible hosts file, keep it under workdir_dir template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/hosts_template.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/scaleup_hosts-{{ env_type }}-{{ guid }}" + src: "./files/hosts_template.j2" + dest: "{{workdir_dir}}/scaleup_hosts-{{ env_type }}-{{ guid }}" delegate_to: localhost become: false tags: - generate_ansible_hosts_file - name: Copy over ansible hosts file copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/scaleup_hosts-{{ env_type }}-{{ guid }}" + src: "{{workdir_dir}}/scaleup_hosts-{{ env_type }}-{{ guid }}" dest: /etc/ansible/scaleup_hosts ## Run Scaleup playbook @@ -137,8 +137,8 @@ gather_facts: False become: yes hosts: bastions[0] - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - installing_openshift ## Change to scale up, and change inventory file @@ -158,9 +158,9 @@ connection: local become: False gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - generate_ansible_hosts_file tasks: @@ -177,9 +177,9 @@ - name: Remove hosts from group newnodes gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + hosts: newnodes tasks: - group: @@ -191,9 +191,9 @@ hosts: bastions become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - openshift_host_templates tasks: @@ -201,10 +201,10 @@ msg: "WARNING: s3user credentials not set" when: s3user_access_key is not defined - - name: generate ansible hosts file, keep it under workdir + - name: generate ansible hosts file, keep it under workdir_dir template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/hosts_template.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ env_type }}-{{ guid }}" + src: "./files/hosts_template.j2" + dest: "{{workdir_dir}}/hosts-{{ env_type }}-{{ guid }}" delegate_to: localhost become: false tags: @@ -212,6 +212,6 @@ - name: Copy over ansible hosts file copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ project_tag }}" + src: "{{workdir_dir}}/hosts-{{ project_tag }}" dest: /etc/ansible/hosts backup: yes diff --git a/ansible/configs/ocp-storage-cns/README.adoc b/ansible/configs/ocp-storage-cns/README.adoc index 2ccf6032552..e175ca55431 100644 --- a/ansible/configs/ocp-storage-cns/README.adoc +++ b/ansible/configs/ocp-storage-cns/README.adoc @@ -83,7 +83,7 @@ LOG_FILE=$(pwd)/${ENVTYPE}-${GUID}.log -e "email=name@example.com" \ -e "repo_method=file" -e "own_repo_path=${REPO_PATH}" -e "repo_version=${REPO_VERSION}" \ -e "software_to_deploy=openshift" -e "osrelease=3.6.173.0.21" -e "docker_version=1.12.6" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ --skip-tags=installing_openshift,get_openshift_credentials 1>> $LOG_FILE 2>> $LOG_FILE . To Delete an environment @@ -93,7 +93,7 @@ ansible-playbook \ ${DEPLOYER_REPO_PATH}/configs/${ENVTYPE}/destroy_env.yml \ -e "guid=${GUID}" -e "env_type=${ENVTYPE}" \ -e "cloud_provider=${CLOUDPROVIDER}" -e "aws_region=${REGION}" -e "HostedZoneId=${HOSTZONEID}" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "key_name=${KEYNAME}" -e "subdomain_base_suffix=${BASESUFFIX}" ---- diff --git a/ansible/configs/ocp-storage-cns/destroy_env.yml b/ansible/configs/ocp-storage-cns/destroy_env.yml index 1dd6f1a8b43..432e278fe64 100644 --- a/ansible/configs/ocp-storage-cns/destroy_env.yml +++ b/ansible/configs/ocp-storage-cns/destroy_env.yml @@ -3,9 +3,9 @@ connection: local gather_facts: False become: no - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tasks: - name: Destroy cloudformation template diff --git a/ansible/configs/ocp-storage-cns/post_infra.yml b/ansible/configs/ocp-storage-cns/post_infra.yml index 2bf99e4d544..161dce95938 100644 --- a/ansible/configs/ocp-storage-cns/post_infra.yml +++ b/ansible/configs/ocp-storage-cns/post_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure diff --git a/ansible/configs/ocp-storage-cns/post_ocp_nfs_config.yml b/ansible/configs/ocp-storage-cns/post_ocp_nfs_config.yml index 2829ecf4a58..854b77d3eb7 100644 --- a/ansible/configs/ocp-storage-cns/post_ocp_nfs_config.yml +++ b/ansible/configs/ocp-storage-cns/post_ocp_nfs_config.yml @@ -2,8 +2,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Create user vols shell: "mkdir -p /srv/nfs/user-vols/vol{1..{{user_vols}}}" @@ -14,8 +14,8 @@ hosts: bastions gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: get nfs Hostname set_fact: @@ -28,7 +28,7 @@ - name: Generate PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/pvs.j2" + src: "./files/pvs.j2" dest: "/root/pvs-{{ env_type }}-{{ guid }}.yml" tags: [ gen_pv_file ] when: pv_list.0 is defined @@ -42,7 +42,7 @@ - name: Generate user vol PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/userpvs.j2" + src: "./files/userpvs.j2" dest: "/root/userpvs-{{ env_type }}-{{ guid }}.yml" tags: - gen_user_vol_pv diff --git a/ansible/configs/ocp-storage-cns/post_software.yml b/ansible/configs/ocp-storage-cns/post_software.yml index f4dca84aaca..eb625be9d63 100644 --- a/ansible/configs/ocp-storage-cns/post_software.yml +++ b/ansible/configs/ocp-storage-cns/post_software.yml @@ -4,23 +4,23 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step005 tasks: - name: Generate /etc/ansible/hosts file with lab hosts template template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/labs_hosts_template.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" + src: "./files/labs_hosts_template.j2" + dest: "{{workdir_dir}}/labs_hosts-{{ env_type }}-{{ guid }}" - name: Configure NFS host for user-vols if required hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Create user vols shell: "mkdir -p /srv/nfs/user-vols/vol{1..{{user_vols}}}" @@ -37,8 +37,8 @@ become: yes tags: - opentlc_bastion_tasks - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Move complete inventory file to preserve directory. shell: mv /etc/ansible/hosts /var/preserve/ @@ -47,7 +47,7 @@ - name: Copy over ansible hosts file, lab version copy: backup: no - src: "{{ ANSIBLE_REPO_PATH }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" + src: "{{workdir_dir}}/labs_hosts-{{ env_type }}-{{ guid }}" dest: /etc/ansible/hosts tags: - overwrite_hosts_with_lab_hosts @@ -66,7 +66,7 @@ - openshift_nfs_config - name: Generate PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/pvs.j2" + src: "./files/pvs.j2" dest: "/root/pvs-{{ env_type }}-{{ guid }}.yml" tags: [ gen_pv_file ] when: pv_list.0 is defined @@ -82,7 +82,7 @@ - name: Generate user vol PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/userpvs.j2" + src: "./files/userpvs.j2" dest: "/root/userpvs-{{ env_type }}-{{ guid }}.yml" tags: - gen_user_vol_pv @@ -101,7 +101,7 @@ - openshift_nfs_config - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool - name: PostSoftware flight-check @@ -109,9 +109,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/ocp-storage-cns/pre_infra.yml b/ansible/configs/ocp-storage-cns/pre_infra.yml index ee24d70ac7f..06a77c18bf6 100644 --- a/ansible/configs/ocp-storage-cns/pre_infra.yml +++ b/ansible/configs/ocp-storage-cns/pre_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step000 - pre_infrastructure diff --git a/ansible/configs/ocp-storage-cns/pre_software.yml b/ansible/configs/ocp-storage-cns/pre_software.yml index 4b211c9c3b5..bff973de714 100644 --- a/ansible/configs/ocp-storage-cns/pre_software.yml +++ b/ansible/configs/ocp-storage-cns/pre_software.yml @@ -4,29 +4,29 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step003 - generate_env_keys tasks: - name: Generate SSH kseys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{workdir_dir}}/{{env_authorized_key}}" when: set_env_authorized_key - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + path: "{{workdir_dir}}/{{env_authorized_key}}" mode: 0400 when: set_env_authorized_key - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{env_authorized_key}}" > "{{workdir_dir}}/{{env_authorized_key}}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + creates: "{{workdir_dir}}/{{env_authorized_key}}.pub" when: set_env_authorized_key # Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} @@ -35,26 +35,26 @@ hosts: all become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-student-user", when: student_password is defined } + - { role: "bastion", when: 'install_bastion' } + - { role: "bastion-student-user", when: student_password is defined } tags: - step004 @@ -66,9 +66,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/ocp-workloads/ocp-workload.yml b/ansible/configs/ocp-workloads/ocp-workload.yml index 68ab30c5d53..6a3a5ff0277 100644 --- a/ansible/configs/ocp-workloads/ocp-workload.yml +++ b/ansible/configs/ocp-workloads/ocp-workload.yml @@ -2,10 +2,10 @@ hosts: all become: false gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - step007 roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/{{ocp_workload}}" + - role: "{{ocp_workload}}" when: ocp_workload is defined diff --git a/ansible/configs/ocp-workshop/README.adoc b/ansible/configs/ocp-workshop/README.adoc index 01a0025c5f3..38fcd445e88 100644 --- a/ansible/configs/ocp-workshop/README.adoc +++ b/ansible/configs/ocp-workshop/README.adoc @@ -43,7 +43,7 @@ zabbix_auto_registration_pass: "XXXXX" === Add new users on the bastion -For managing users on the bastion, you can override the `mgr_users` variable. The default is located in `{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/mgr_users.yml`, and looks like : +For managing users on the bastion, you can override the `mgr_users` variable. The default is located in `{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/mgr_users.yml`, and looks like : .Default mgr_users.yml [source,yaml] @@ -99,7 +99,7 @@ ansible-playbook main.yml -e "guid=${GUID}" -e "env_type=${ENVTYPE}" \ -e "nfs_instance_type=m3.large" -e "node_instance_count=5" \ -e "email=name@example.com" \ -e "install_idm=htpasswd" -e "software_to_deploy=openshift" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" -e "own_repo_path=${REPO_PATH}" --skip-tags=remove_self_provisioners + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" -e "own_repo_path=${REPO_PATH}" --skip-tags=remove_self_provisioners ---- @@ -134,7 +134,7 @@ ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \ -e "repo_method=satellite" -e "repo_version=${REPO_VERSION}" \ -e "email=name@example.com" \ -e "software_to_deploy=openshift" -e "osrelease=3.5.5.15" -e "docker_version=1.12.6" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE ---- === Advanced Development Workshop @@ -161,7 +161,7 @@ ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \ -e "nfs_instance_type=t2.large" -e "node_instance_count=${NODE_COUNT}" \ -e "install_idm=htpasswd" -e "software_to_deploy=openshift" \ -e "email=name@example.com" \ - -e "own_repo_path=${REPO_PATH}" -e"repo_method=rhn" -e"ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "own_repo_path=${REPO_PATH}" -e"repo_method=rhn" -e"ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "osrelease=3.5.5.31" -e "repo_version=${REPO_VERSION}" -e "docker_version=1.12.6" \ --skip-tags=remove_self_provisioners,opentlc-integration ---- @@ -200,7 +200,7 @@ REPO_VERSION=3.5 NODE_COUNT=4 NEW_NODE_COUNT=2 ansible-playbook ./configs/${ENVTYPE}/scaleup.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "HostedZoneId=${HOSTZONEID}" \ -e "bastion_instance_type=t2.large" \ -e "cloud_provider=${CLOUDPROVIDER}" \ diff --git a/ansible/configs/ocp-workshop/destroy_env.yml b/ansible/configs/ocp-workshop/destroy_env.yml index b5773d6fb78..d0d1a33e1a8 100644 --- a/ansible/configs/ocp-workshop/destroy_env.yml +++ b/ansible/configs/ocp-workshop/destroy_env.yml @@ -4,9 +4,9 @@ connection: local gather_facts: False become: no - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tasks: - name: Delete S3 bucket @@ -62,5 +62,5 @@ tags: [ destroying, destroy_cf_deployment ] - name: Import default azure destroy playbook - import_playbook: "{{ANSIBLE_REPO_PATH}}/cloud_providers/azure_destroy_env.yml" + import_playbook: "{{workdir_dir}}/cloud_providers/azure_destroy_env.yml" when: cloud_provider == 'azure' diff --git a/ansible/configs/ocp-workshop/env_tests.yml b/ansible/configs/ocp-workshop/env_tests.yml index 9ccce7adbc1..798b77c833a 100644 --- a/ansible/configs/ocp-workshop/env_tests.yml +++ b/ansible/configs/ocp-workshop/env_tests.yml @@ -3,7 +3,7 @@ - name: ocp-workshop tests hosts: masters[0] become: yes - vars_files: + - "./{{ env_type }}_vars.yml" - "./{{ env_type }}_secret_vars.yml" diff --git a/ansible/configs/ocp-workshop/ocp_workloads.yml b/ansible/configs/ocp-workshop/ocp_workloads.yml index 2fac1c8a0fc..ceacf90b44e 100644 --- a/ansible/configs/ocp-workshop/ocp_workloads.yml +++ b/ansible/configs/ocp-workshop/ocp_workloads.yml @@ -4,9 +4,9 @@ gather_facts: false run_once: true become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tasks: - name: Install ocp-infra workloads when: @@ -25,7 +25,7 @@ block: - name: Deploy ocp-infra workloads include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/{{ workload_loop_var }}" + name: "{{ workload_loop_var }}" vars: ocp_username: "{{ admin_user }}" become_override: yes @@ -60,7 +60,7 @@ - name: Deploy ocp-workloads for each user ID include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/{{ workload_loop_var[1] }}" + name: "{{ workload_loop_var[1] }}" vars: ocp_username: "user{{ workload_loop_var[0] }}" become_override: yes diff --git a/ansible/configs/ocp-workshop/post_infra.yml b/ansible/configs/ocp-workshop/post_infra.yml index 33cf2b941c6..823896bde57 100644 --- a/ansible/configs/ocp-workshop/post_infra.yml +++ b/ansible/configs/ocp-workshop/post_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step002 - post_infrastructure @@ -41,7 +41,7 @@ - name: write down s3user credentials copy: - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.s3user.credentials" + dest: "{{workdir_dir}}/{{ env_type }}.{{ guid }}.s3user.credentials" content: | * S3 Bucket for registry: {{s3user}} ** S3User access key: {{s3user_access_key}} @@ -62,7 +62,7 @@ - name: write down Route53User credentials copy: - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.route53user.credentials" + dest: "{{workdir_dir}}/{{ env_type }}.{{ guid }}.route53user.credentials" content: | * Route53 User for Let's Encrypt: {{ route53user }} ** Route53User access key: {{ route53user_access_key }} diff --git a/ansible/configs/ocp-workshop/post_software.yml b/ansible/configs/ocp-workshop/post_software.yml index 0a61f98b5f8..9c0b84eaa47 100644 --- a/ansible/configs/ocp-workshop/post_software.yml +++ b/ansible/configs/ocp-workshop/post_software.yml @@ -3,8 +3,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - when: - install_nfs|d(True)|bool @@ -30,8 +30,8 @@ run_once: true gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - when: - install_nfs|bool @@ -48,7 +48,7 @@ - name: Generate PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/pvs.j2" + src: "./files/pvs.j2" dest: "/root/pvs-{{ env_type }}-{{ guid }}.yml" tags: [ gen_pv_file ] when: pv_list.0 is defined @@ -62,7 +62,7 @@ - name: Generate user vol PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/userpvs.j2" + src: "./files/userpvs.j2" dest: "/root/userpvs-{{ env_type }}-{{ guid }}.yml" tags: - gen_user_vol_pv @@ -84,7 +84,7 @@ nfs_host: "{{ groups['support']|sort|first }}" - name: Deploy Dynamic NFS Provisioner include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-dynamic-nfs-provisioner" + name: "ocp-dynamic-nfs-provisioner" vars: nfs_provisioner_nfs_server_hostname: "{{ nfs_host }}" nfs_provisioner_storage_class_is_default: True @@ -95,8 +95,8 @@ run_once: true become: yes gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - env-specific_infra @@ -130,10 +130,10 @@ hosts: bastions become: yes gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/mgr_users.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/mgr_users.yml" + + tags: - env-specific - cf_integration @@ -141,7 +141,7 @@ tasks: - name: Configure Bastion include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/opentlc-integration" + name: "opentlc-integration" vars: no_log: yes when: install_opentlc_integration|bool @@ -162,8 +162,8 @@ run_once: true become: yes gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - env-specific_infra @@ -215,8 +215,8 @@ run_once: true become: yes gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: [ env-specific, remove_self_provisioners ] tasks: - when: remove_self_provisioners|bool @@ -239,8 +239,8 @@ hosts: masters gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - project_request @@ -311,8 +311,8 @@ hosts: nodes gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - env_specific_images @@ -327,8 +327,8 @@ # run_once: true # become: yes # gather_facts: False -# vars_files: -# - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" +# +# # tags: # - env-specific # - env_specific_images @@ -365,8 +365,8 @@ become: yes hosts: masters run_once: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Fix cri-o garbage collection when: @@ -386,14 +386,14 @@ run_once: true gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - install_openwhisk tasks: - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-infra-openwhisk" + name: "ocp-infra-openwhisk" when: - install_openwhisk|d(False)|bool @@ -407,13 +407,13 @@ - infranodes - masters - bastions - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - install_prometheus tasks: - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-infra-prometheus-pre310" + name: "ocp-infra-prometheus-pre310" when: - install_prometheus|d(False)|bool - osrelease is version_compare("3.10", "<") @@ -424,8 +424,8 @@ become: yes hosts: - infranodes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - install_prometheus tasks: @@ -442,8 +442,8 @@ hosts: - bastions run_once: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - install_prometheus tasks: @@ -469,12 +469,12 @@ run_once: true gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Customize Service Catalog UI for workshops include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-infra-enable-custom-catalog" + name: "ocp-infra-enable-custom-catalog" when: - enable_workshops_catalog|d(False)|bool - osrelease is version_compare("3.9", ">=") @@ -487,11 +487,11 @@ run_once: true gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-infra-nexus" + name: "ocp-infra-nexus" vars: nexus_project: "{{admin_project}}" when: install_nexus|d(False)|bool @@ -504,14 +504,14 @@ run_once: true gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - install_aws_broker tasks: - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-infra-aws-service-broker" + name: "ocp-infra-aws-service-broker" when: install_aws_broker|d(False)|bool - name: Update Ansible (Automation) Broker to show images from DockerHub @@ -519,15 +519,15 @@ run_once: true gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - install_openshiftapb tasks: - name: Update ASB include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift-ansible-broker" + name: "openshift-ansible-broker" when: install_openshiftapb|d(False)|bool - name: Install Maistra (Istio) @@ -535,15 +535,15 @@ run_once: true gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - install_maistra tasks: - name: Install Maistra include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-infra-maistra" + name: "ocp-infra-maistra" vars: openshift_master_public: "{{ master_lb_dns }}" when: install_maistra|d(False)|bool @@ -554,20 +554,20 @@ hosts: masters gather_facts: true become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + vars: zabbix_auto_registration_keyword: OCP Master tasks: - when: install_zabbix|bool block: - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client" + name: "zabbix-client" - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client-openshift-master" + name: "zabbix-client-openshift-master" - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client-openshift-node" + name: "zabbix-client-openshift-node" tags: - env-specific - install_zabbix @@ -578,9 +578,9 @@ - infranodes gather_facts: true become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + vars: zabbix_auto_registration_keyword: OCP Node zabbix_token: "{{ hostvars[groups['masters'][0]].zabbix_token }}" @@ -589,9 +589,9 @@ - when: install_zabbix|bool block: - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client" + name: "zabbix-client" - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client-openshift-node" + name: "zabbix-client-openshift-node" tags: - env-specific - install_zabbix @@ -602,15 +602,15 @@ - support gather_facts: true become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + vars: zabbix_auto_registration_keyword: OCP Host tasks: - when: install_zabbix|bool include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client" + name: "zabbix-client" tags: - env-specific - install_zabbix @@ -621,8 +621,8 @@ become: yes gather_facts: False run_once: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - when: - osrelease is version_compare('3.9', '>=') @@ -652,7 +652,7 @@ - name: Fetch the diagnostic archive and logs fetch: src: /tmp/diagnostics.tar.gz - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{project_tag}}_diagnostics.tar.gz" + dest: "{{workdir_dir}}/{{project_tag}}_diagnostics.tar.gz" flat: true - name: Report diagnostics failure @@ -665,12 +665,12 @@ become: yes gather_facts: False run_once: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tasks: - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool - name: PostSoftware flight-check @@ -678,8 +678,8 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - post_flight_check tasks: @@ -689,8 +689,8 @@ - name: Gather facts hosts: - all - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + gather_facts: true tags: - ocp_report @@ -700,9 +700,9 @@ connection: local become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - ocp_report vars: @@ -711,7 +711,7 @@ - name: get repo version used to deploy command: git rev-parse HEAD args: - chdir: "{{ ANSIBLE_REPO_PATH }}" + chdir: "{{ ANSIBLE_REPO_PATH | default('.') }}" register: ansible_agnostic_deployer_head - name: Gather ec2 facts @@ -727,8 +727,8 @@ - cloud_provider == 'ec2' - name: Generate report template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/ocp_report.adoc.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/ocp_report_{{ env_type }}-{{ guid }}.adoc" + src: "./files/ocp_report.adoc.j2" + dest: "{{workdir_dir}}/ocp_report_{{ env_type }}-{{ guid }}.adoc" when: - ocp_report|bool - cloud_provider == 'ec2' diff --git a/ansible/configs/ocp-workshop/pre_infra.yml b/ansible/configs/ocp-workshop/pre_infra.yml index 444cc902a90..129fa387876 100644 --- a/ansible/configs/ocp-workshop/pre_infra.yml +++ b/ansible/configs/ocp-workshop/pre_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure diff --git a/ansible/configs/ocp-workshop/pre_software.yml b/ansible/configs/ocp-workshop/pre_software.yml index 8e967e2abee..3e85bc290cd 100644 --- a/ansible/configs/ocp-workshop/pre_software.yml +++ b/ansible/configs/ocp-workshop/pre_software.yml @@ -4,29 +4,29 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step003 - generate_env_keys tasks: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{workdir_dir}}/{{env_authorized_key}}" when: set_env_authorized_key - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + path: "{{workdir_dir}}/{{env_authorized_key}}" mode: 0400 when: set_env_authorized_key - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{env_authorized_key}}" > "{{workdir_dir}}/{{env_authorized_key}}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + creates: "{{workdir_dir}}/{{env_authorized_key}}.pub" when: set_env_authorized_key # Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} @@ -36,9 +36,9 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks @@ -61,11 +61,11 @@ - osrelease is version_compare('3.9', '>=') - osrelease is version_compare('3.11', '<') roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories" + - role: "set-repositories" when: repo_method is defined - - role: "{{ ANSIBLE_REPO_PATH }}/roles/common" + - role: "common" when: install_common|bool - - role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key" + - role: "set_env_authorized_key" when: set_env_authorized_key|bool - name: Install Let's Encrypt Wildcard Certificates @@ -73,12 +73,12 @@ run_once: true become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Create Let's Encrypt Certificates include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/host-lets-encrypt-certs" + name: "host-lets-encrypt-certs" vars: - acme_domain: "{{ master_lb_dns }}" - acme_wildcard_domain: "*.{{ cloudapps_suffix }}" @@ -86,10 +86,10 @@ - acme_aws_secret_access_key: "{{ hostvars['localhost'].route53user_secret_access_key }}" - acme_production: "{{ lets_encrypt_production|d(False)|bool}}" - acme_remote_dir: "/root" - - acme_cache_cert_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}.cert" - - acme_cache_key_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}.key" - - acme_cache_archive_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}_acme.tgz" - - acme_cache_ca_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}_ca.cert" + - acme_cache_cert_file: "{{workdir_dir}}/{{guid}}.cert" + - acme_cache_key_file: "{{workdir_dir}}/{{guid}}.key" + - acme_cache_archive_file: "{{workdir_dir}}/{{guid}}_acme.tgz" + - acme_cache_ca_file: "{{workdir_dir}}/{{guid}}_ca.cert" - acme_renew_automatically: True - acme_force_issue: False when: @@ -99,11 +99,11 @@ hosts: bastions become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion" + - role: "bastion" when: install_bastion | bool tags: - step004 @@ -114,9 +114,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: @@ -127,8 +127,8 @@ hosts: masters gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - project_request diff --git a/ansible/configs/ocp-workshop/scaleup.yml b/ansible/configs/ocp-workshop/scaleup.yml index 518c01fc2c6..5bfdcc169c0 100644 --- a/ansible/configs/ocp-workshop/scaleup.yml +++ b/ansible/configs/ocp-workshop/scaleup.yml @@ -21,7 +21,7 @@ ################################################################################# ################################################################################# -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/cloud_providers/{{ cloud_provider }}_infrastructure_deployment.yml" +- import_playbook: "{{ ANSIBLE_REPO_PATH | default('.') }}/cloud_providers/{{ cloud_provider }}_infrastructure_deployment.yml" tags: - step001 - deploy_infrastructure @@ -70,9 +70,9 @@ - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: PreSoftware flight-check hosts: localhost @@ -93,7 +93,7 @@ hosts: - "newnodes" roles: - - "{{ ANSIBLE_REPO_PATH }}/roles/host-ocp-node" + - "host-ocp-node" tags: - openshift_node_tasks @@ -104,17 +104,17 @@ tags: - openshift_host_templates tasks: - - name: Generate ansible hosts file, keep it under workdir + - name: Generate ansible hosts file, keep it under workdir_dir template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/hosts_template.{{ osrelease }}.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/scaleup_hosts-{{ env_type }}-{{ guid }}" + src: "./files/hosts_template.{{ osrelease }}.j2" + dest: "{{workdir_dir}}/scaleup_hosts-{{ env_type }}-{{ guid }}" delegate_to: localhost become: false tags: - generate_ansible_hosts_file - name: Copy over ansible hosts file copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/scaleup_hosts-{{ env_type }}-{{ guid }}" + src: "{{workdir_dir}}/scaleup_hosts-{{ env_type }}-{{ guid }}" dest: /etc/ansible/scaleup_hosts ## Run Scaleup playbook @@ -201,10 +201,10 @@ msg: "WARNING: s3user credentials not set" when: s3user_access_key is not defined - - name: Generate ansible hosts file, keep it under workdir + - name: generate ansible hosts file, keep it under workdir_dir template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/hosts_template.{{ osrelease }}.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ env_type }}-{{ guid }}" + src: "./files/hosts_template.{{ osrelease }}.j2" + dest: "{{workdir_dir}}/hosts-{{ env_type }}-{{ guid }}" delegate_to: localhost become: false tags: @@ -212,6 +212,6 @@ - name: Copy over ansible hosts file copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ project_tag }}" + src: "{{workdir_dir}}/hosts-{{ project_tag }}" dest: /etc/ansible/hosts backup: yes diff --git a/ansible/configs/ocp4-coreos-deployer/README.adoc b/ansible/configs/ocp4-coreos-deployer/README.adoc index b44d426cfa2..a107d9bc219 100644 --- a/ansible/configs/ocp4-coreos-deployer/README.adoc +++ b/ansible/configs/ocp4-coreos-deployer/README.adoc @@ -66,7 +66,7 @@ ansible-playbook main.yml \ -e "clientvm_instance_type=t2.small" \ -e "email=name@example.com" \ -e "software_to_deploy=none" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" # -e "own_repo_path=${REPO_PATH}" @@ -107,7 +107,7 @@ ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \ -e "software_to_deploy=none" \ -e "osrelease=3.9.14" \ -e "docker_version=1.13.1" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE ---- === To Delete an environment diff --git a/ansible/configs/ocp4-coreos-deployer/destroy_env.yml b/ansible/configs/ocp4-coreos-deployer/destroy_env.yml index 888284b9cbb..2b897fd3293 100644 --- a/ansible/configs/ocp4-coreos-deployer/destroy_env.yml +++ b/ansible/configs/ocp4-coreos-deployer/destroy_env.yml @@ -4,9 +4,9 @@ connection: local gather_facts: False become: no - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tasks: - debug: diff --git a/ansible/configs/ocp4-coreos-deployer/post_infra.yml b/ansible/configs/ocp4-coreos-deployer/post_infra.yml index 0ea7a1f5abb..5c5a7c400a0 100644 --- a/ansible/configs/ocp4-coreos-deployer/post_infra.yml +++ b/ansible/configs/ocp4-coreos-deployer/post_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure diff --git a/ansible/configs/ocp4-coreos-deployer/post_software.yml b/ansible/configs/ocp4-coreos-deployer/post_software.yml index d790d42b45d..0b3aac1670a 100644 --- a/ansible/configs/ocp4-coreos-deployer/post_software.yml +++ b/ansible/configs/ocp4-coreos-deployer/post_software.yml @@ -3,8 +3,8 @@ hosts: bastions become: yes gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - debug: msg: "Post-Software Steps starting" @@ -14,9 +14,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/ocp4-coreos-deployer/pre_infra.yml b/ansible/configs/ocp4-coreos-deployer/pre_infra.yml index 4b0fd83e01e..873d2d0c7a9 100644 --- a/ansible/configs/ocp4-coreos-deployer/pre_infra.yml +++ b/ansible/configs/ocp4-coreos-deployer/pre_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure diff --git a/ansible/configs/ocp4-coreos-deployer/pre_software.yml b/ansible/configs/ocp4-coreos-deployer/pre_software.yml index f20b6cc109a..d6b6447cb70 100644 --- a/ansible/configs/ocp4-coreos-deployer/pre_software.yml +++ b/ansible/configs/ocp4-coreos-deployer/pre_software.yml @@ -4,29 +4,29 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step003 - generate_env_keys tasks: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{workdir_dir}}/{{env_authorized_key}}" when: set_env_authorized_key - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + path: "{{workdir_dir}}/{{env_authorized_key}}" mode: 0400 when: set_env_authorized_key - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{env_authorized_key}}" > "{{workdir_dir}}/{{env_authorized_key}}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + creates: "{{workdir_dir}}/{{env_authorized_key}}.pub" when: set_env_authorized_key # Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} @@ -35,27 +35,27 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-student-user", when: 'install_student_user' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa", when: 'install_ipa_client' } + - { role: "bastion", when: 'install_bastion' } + - { role: "bastion-student-user", when: 'install_student_user' } + - { role: "bastion-opentlc-ipa", when: 'install_ipa_client' } tags: - step004 - bastion_tasks @@ -65,9 +65,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/ocp4-coreos-deployer/software.yml b/ansible/configs/ocp4-coreos-deployer/software.yml index 99b24e2842d..761a190df6d 100644 --- a/ansible/configs/ocp4-coreos-deployer/software.yml +++ b/ansible/configs/ocp4-coreos-deployer/software.yml @@ -3,9 +3,9 @@ hosts: localhost gather_facts: False become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tasks: - debug: msg: "Software tasks started" @@ -14,13 +14,13 @@ # hosts: bastions # gather_facts: false # become: true -# vars_files: -# - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" -# - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" +# +# +# # tasks: # - name: Set up Client VM # include_role: -# name: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-client-vm" +# name: "ocp-client-vm" - debug: msg: "Software tasks completed" diff --git a/ansible/configs/openshift-demos/idle.yml b/ansible/configs/openshift-demos/idle.yml index b34515968dc..4758974ee1a 100644 --- a/ansible/configs/openshift-demos/idle.yml +++ b/ansible/configs/openshift-demos/idle.yml @@ -3,13 +3,13 @@ hosts: all gather_facts: false run_once: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - - import_tasks: "{{ ANSIBLE_REPO_PATH }}/configs/{{env_type}}/create_oc_config.yml" + - import_tasks: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{env_type}}/create_oc_config.yml" - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_commons_facts" + name: "openshift_commons_facts" vars: set_hostname_suffix: false diff --git a/ansible/configs/openshift-demos/imagebuild-pipeline.yml b/ansible/configs/openshift-demos/imagebuild-pipeline.yml index 71282cf9f65..dc9818bf5dc 100644 --- a/ansible/configs/openshift-demos/imagebuild-pipeline.yml +++ b/ansible/configs/openshift-demos/imagebuild-pipeline.yml @@ -11,7 +11,7 @@ pipeline_template: https://raw.githubusercontent.com/{{ github_account }}/coolstore-microservice/{{ github_ref }}/openshift/templates/imagebuild-pipeline-template.yaml tasks: - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_commons_facts" + name: "openshift_commons_facts" vars: set_hostname_suffix: false diff --git a/ansible/configs/openshift-demos/msa-cicd-eap-full.yml b/ansible/configs/openshift-demos/msa-cicd-eap-full.yml index 0eb15708fdc..ba0c9890fe9 100644 --- a/ansible/configs/openshift-demos/msa-cicd-eap-full.yml +++ b/ansible/configs/openshift-demos/msa-cicd-eap-full.yml @@ -3,20 +3,20 @@ hosts: all gather_facts: false run_once: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - - import_tasks: "{{ ANSIBLE_REPO_PATH }}/configs/{{env_type}}/create_oc_config.yml" + - import_tasks: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{env_type}}/create_oc_config.yml" - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_commons_facts" + name: "openshift_commons_facts" tags: - cicd - guides - demo - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_gogs" + name: "openshift_gogs" vars: project_name: "{{ project_cicd }}" project_display_name: "{{ project_cicd_name }}" @@ -26,7 +26,7 @@ tags: cicd - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_sonatype_nexus" + name: "openshift_sonatype_nexus" vars: project_name: "{{ project_cicd }}" when: > @@ -36,7 +36,7 @@ tags: cicd - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_jenkins" + name: "openshift_jenkins" vars: project_name: "{{ project_cicd }}" jenkins_image_tag: "v3.7" @@ -44,7 +44,7 @@ tags: cicd - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_workshopper" + name: "openshift_workshopper" vars: project_name: "{{ project_cicd }}" workshopper_content_url_prefix: https://raw.githubusercontent.com/siamaksade/coolstore-demo-guides/openshift-3.7 @@ -64,7 +64,7 @@ tags: guides - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_coolstore" + name: "openshift_coolstore" vars: project_annotations: "demo=demo-msa-cicd-eap-{{ project_suffix }}" hostname_suffix: "{{ apps_hostname_suffix }}" diff --git a/ansible/configs/openshift-demos/msa-cicd-eap-min.yml b/ansible/configs/openshift-demos/msa-cicd-eap-min.yml index d43d6a861d8..33e82e20d65 100644 --- a/ansible/configs/openshift-demos/msa-cicd-eap-min.yml +++ b/ansible/configs/openshift-demos/msa-cicd-eap-min.yml @@ -3,21 +3,21 @@ hosts: all gather_facts: false run_once: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - - import_tasks: "{{ ANSIBLE_REPO_PATH }}/configs/{{env_type}}/create_oc_config.yml" + - import_tasks: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{env_type}}/create_oc_config.yml" - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_commons_facts" + name: "openshift_commons_facts" tags: - cicd - guides - demo - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_gogs" + name: "openshift_gogs" vars: project_name: "{{ project_cicd }}" project_display_name: "{{ project_cicd_name }}" @@ -27,7 +27,7 @@ tags: cicd - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_sonatype_nexus" + name: "openshift_sonatype_nexus" vars: project_name: "{{ project_cicd }}" when: > @@ -37,7 +37,7 @@ tags: cicd - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_jenkins" + name: "openshift_jenkins" vars: project_name: "{{ project_cicd }}" jenkins_image_tag: "v3.7" @@ -45,7 +45,7 @@ tags: cicd - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_workshopper" + name: "openshift_workshopper" vars: project_name: "{{ project_cicd }}" workshopper_content_url_prefix: https://raw.githubusercontent.com/siamaksade/coolstore-demo-guides/openshift-3.7 @@ -65,7 +65,7 @@ tags: guides - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_coolstore" + name: "openshift_coolstore" vars: project_annotations: "demo=demo-msa-cicd-eap-{{ project_suffix }}" hostname_suffix: "{{ apps_hostname_suffix }}" diff --git a/ansible/configs/openshift-demos/msa-full.yml b/ansible/configs/openshift-demos/msa-full.yml index 45579aaa626..903a8ed4d2a 100644 --- a/ansible/configs/openshift-demos/msa-full.yml +++ b/ansible/configs/openshift-demos/msa-full.yml @@ -3,17 +3,17 @@ hosts: all gather_facts: false run_once: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - - import_tasks: "{{ ANSIBLE_REPO_PATH }}/configs/{{env_type}}/create_oc_config.yml" + - import_tasks: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{env_type}}/create_oc_config.yml" - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_commons_facts" + name: "openshift_commons_facts" - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_coolstore" + name: "openshift_coolstore" vars: project_annotations: "demo=demo-msa-{{ project_suffix }}" hostname_suffix: "{{ apps_hostname_suffix }}" diff --git a/ansible/configs/openshift-demos/msa-min.yml b/ansible/configs/openshift-demos/msa-min.yml index a7f495d50e5..e07aea87128 100644 --- a/ansible/configs/openshift-demos/msa-min.yml +++ b/ansible/configs/openshift-demos/msa-min.yml @@ -3,17 +3,17 @@ hosts: all gather_facts: false run_once: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - - import_tasks: "{{ ANSIBLE_REPO_PATH }}/configs/{{env_type}}/create_oc_config.yml" + - import_tasks: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{env_type}}/create_oc_config.yml" - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_commons_facts" + name: "openshift_commons_facts" - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_coolstore" + name: "openshift_coolstore" vars: project_annotations: "demo=demo-msa-{{ project_suffix }}" hostname_suffix: "{{ apps_hostname_suffix }}" diff --git a/ansible/configs/openshift-demos/undeploy.yml b/ansible/configs/openshift-demos/undeploy.yml index 7f705264271..359f0e67190 100644 --- a/ansible/configs/openshift-demos/undeploy.yml +++ b/ansible/configs/openshift-demos/undeploy.yml @@ -3,13 +3,13 @@ hosts: all gather_facts: false run_once: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - - import_tasks: "{{ ANSIBLE_REPO_PATH }}/configs/{{env_type}}/create_oc_config.yml" + - import_tasks: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{env_type}}/create_oc_config.yml" - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_commons_facts" + name: "openshift_commons_facts" vars: set_hostname_suffix: false diff --git a/ansible/configs/openshift-demos/unidle.yml b/ansible/configs/openshift-demos/unidle.yml index 1b9d40137f4..c1e694726bd 100644 --- a/ansible/configs/openshift-demos/unidle.yml +++ b/ansible/configs/openshift-demos/unidle.yml @@ -5,7 +5,7 @@ run_once: true tasks: - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_commons_facts" + name: "openshift_commons_facts" # default project - name: check if {{ project_default }} exists diff --git a/ansible/configs/quay-enterprise/README.adoc b/ansible/configs/quay-enterprise/README.adoc index 1765432f418..6dec9c70a2e 100644 --- a/ansible/configs/quay-enterprise/README.adoc +++ b/ansible/configs/quay-enterprise/README.adoc @@ -69,7 +69,7 @@ ansible-playbook main.yml \ -e "clientvm_instance_type=t2.large" \ -e "email=name@example.com" \ -e "software_to_deploy=none" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "own_repo_path=${REPO_PATH}" ---- @@ -108,7 +108,7 @@ ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \ -e "software_to_deploy=none" \ -e "osrelease=3.9.14" \ -e "docker_version=1.13.1" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE ---- === To Delete an environment diff --git a/ansible/configs/quay-enterprise/destroy_env.yml b/ansible/configs/quay-enterprise/destroy_env.yml index 888284b9cbb..2b897fd3293 100644 --- a/ansible/configs/quay-enterprise/destroy_env.yml +++ b/ansible/configs/quay-enterprise/destroy_env.yml @@ -4,9 +4,9 @@ connection: local gather_facts: False become: no - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tasks: - debug: diff --git a/ansible/configs/quay-enterprise/env_vars.yml b/ansible/configs/quay-enterprise/env_vars.yml index dd7e12346f5..27a96ba655c 100644 --- a/ansible/configs/quay-enterprise/env_vars.yml +++ b/ansible/configs/quay-enterprise/env_vars.yml @@ -44,8 +44,8 @@ qe_quay_ssl_lets_encrypt_certs: False qe_quay_ssl_lets_encrypt_production: False qe_quay_ssl_lets_encrypt_force_renew: False qe_quay_ssl_lets_encrypt_renew_automatically: False -#qe_quay_ssl_key_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}.key" -#qe_quay_ssl_cert_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}.cert" +#qe_quay_ssl_key_file: "{{workdir_dir}}/{{guid}}.key" +#qe_quay_ssl_cert_file: "{{workdir_dir}}/{{guid}}.cert" # qe_quay_superuser_username: quayadmin # qe_quay_superuser_password: quaypwd # qe_quay_superuser_email: quayadmin@dummy.com diff --git a/ansible/configs/quay-enterprise/post_infra.yml b/ansible/configs/quay-enterprise/post_infra.yml index b8ab86e53db..8fb39d9d124 100644 --- a/ansible/configs/quay-enterprise/post_infra.yml +++ b/ansible/configs/quay-enterprise/post_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure diff --git a/ansible/configs/quay-enterprise/post_software.yml b/ansible/configs/quay-enterprise/post_software.yml index e9930c64806..8c761900fac 100644 --- a/ansible/configs/quay-enterprise/post_software.yml +++ b/ansible/configs/quay-enterprise/post_software.yml @@ -3,8 +3,8 @@ hosts: bastions become: yes gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - debug: msg: "Post-Software Steps starting" @@ -14,9 +14,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/quay-enterprise/pre_infra.yml b/ansible/configs/quay-enterprise/pre_infra.yml index 444cc902a90..129fa387876 100644 --- a/ansible/configs/quay-enterprise/pre_infra.yml +++ b/ansible/configs/quay-enterprise/pre_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure diff --git a/ansible/configs/quay-enterprise/pre_software.yml b/ansible/configs/quay-enterprise/pre_software.yml index d5d129c52ba..11d0e2d62a0 100644 --- a/ansible/configs/quay-enterprise/pre_software.yml +++ b/ansible/configs/quay-enterprise/pre_software.yml @@ -4,29 +4,29 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step003 - generate_env_keys tasks: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{workdir_dir}}/{{env_authorized_key}}" when: set_env_authorized_key - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + path: "{{workdir_dir}}/{{env_authorized_key}}" mode: 0400 when: set_env_authorized_key - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{env_authorized_key}}" > "{{workdir_dir}}/{{env_authorized_key}}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + creates: "{{workdir_dir}}/{{env_authorized_key}}.pub" when: set_env_authorized_key # Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} @@ -35,26 +35,26 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa", when: 'install_ipa_client' } + - { role: "bastion", when: 'install_bastion' } + - { role: "bastion-opentlc-ipa", when: 'install_ipa_client' } tags: - step004 - bastion_tasks @@ -64,9 +64,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/quay-enterprise/software.yml b/ansible/configs/quay-enterprise/software.yml index 2d290017425..690666d261d 100644 --- a/ansible/configs/quay-enterprise/software.yml +++ b/ansible/configs/quay-enterprise/software.yml @@ -3,8 +3,8 @@ hosts: localhost gather_facts: False become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - debug: msg: "Software tasks started" @@ -42,8 +42,8 @@ - quay_enterprise gather_facts: false become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Request Certificates when: @@ -63,24 +63,24 @@ vars: - acme_domain: "{{ qe_quay_hostname }}.{{ subdomain_base }}" - acme_remote_dir: "/root" - - acme_cache_cert_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}.cert" - - acme_cache_key_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}.key" - - acme_cache_archive_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}_acme.tgz" + - acme_cache_cert_file: "{{workdir_dir}}/{{guid}}.cert" + - acme_cache_key_file: "{{workdir_dir}}/{{guid}}.key" + - acme_cache_archive_file: "{{workdir_dir}}/{{guid}}_acme.tgz" - acme_production: "{{ qe_quay_ssl_lets_encrypt_production|d(False)|bool }}" - acme_renew_automatically: "{{ qe_quay_ssl_lets_encrypt_renew_automatically|d(False)|bool }}" - acme_force_issue: "{{ qe_quay_ssl_lets_encrypt_force_renew|d(False)|bool }}" - name: Set Cert/Key file locations to cached locations set_fact: - qe_quay_ssl_key_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}.key" - qe_quay_ssl_cert_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}.cert" + qe_quay_ssl_key_file: "{{workdir_dir}}/{{guid}}.key" + qe_quay_ssl_cert_file: "{{workdir_dir}}/{{guid}}.cert" - name: Set up Node Software (Docker) hosts: - all_vms gather_facts: false become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Ensure that iptables service is installed yum: @@ -101,8 +101,8 @@ hosts: quay_database gather_facts: false become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Install and Configure PostgreSQL block: @@ -137,8 +137,8 @@ - name: Install Redis hosts: redis become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Install Redis include_role: @@ -150,9 +150,9 @@ hosts: quay_enterprise gather_facts: false become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tasks: - name: Install Quay include_role: @@ -177,8 +177,8 @@ - name: Install and Configure Clair Database hosts: clair_database - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Install PostgreSQL for Clair include_role: @@ -198,13 +198,13 @@ - name: Install Clair hosts: clair - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tasks: - name: Set Clair SSL Certificate set_fact: - qe_quay_ssl_cert_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}.cert" + qe_quay_ssl_cert_file: "{{workdir_dir}}/{{guid}}.cert" when: - qe_quay_ssl_lets_encrypt_certs|d(False)|bool - name: Set SSL Certificate to self signed certificate if no certificate file specified diff --git a/ansible/configs/rhte-lb/README.adoc b/ansible/configs/rhte-lb/README.adoc index 3803e64f982..3619bb572b2 100644 --- a/ansible/configs/rhte-lb/README.adoc +++ b/ansible/configs/rhte-lb/README.adoc @@ -66,7 +66,7 @@ ansible-playbook main.yml \ -e "clientvm_instance_type=t2.large" \ -e "email=name@example.com" \ -e "software_to_deploy=none" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "own_repo_path=${REPO_PATH}" ---- @@ -105,7 +105,7 @@ ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \ -e "software_to_deploy=none" \ -e "osrelease=3.9.14" \ -e "docker_version=1.13.1" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE ---- === To Delete an environment diff --git a/ansible/configs/rhte-lb/destroy_env.yml b/ansible/configs/rhte-lb/destroy_env.yml index 888284b9cbb..2b897fd3293 100644 --- a/ansible/configs/rhte-lb/destroy_env.yml +++ b/ansible/configs/rhte-lb/destroy_env.yml @@ -4,9 +4,9 @@ connection: local gather_facts: False become: no - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tasks: - debug: diff --git a/ansible/configs/rhte-lb/post_infra.yml b/ansible/configs/rhte-lb/post_infra.yml index 75fe98e03e9..900efbb061f 100644 --- a/ansible/configs/rhte-lb/post_infra.yml +++ b/ansible/configs/rhte-lb/post_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure diff --git a/ansible/configs/rhte-lb/post_software.yml b/ansible/configs/rhte-lb/post_software.yml index 103c0e240f6..c78d0ed67db 100644 --- a/ansible/configs/rhte-lb/post_software.yml +++ b/ansible/configs/rhte-lb/post_software.yml @@ -3,8 +3,8 @@ hosts: bastions become: yes gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - debug: msg: "Post-Software Steps starting" @@ -14,9 +14,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/rhte-lb/pre_infra.yml b/ansible/configs/rhte-lb/pre_infra.yml index 4b0fd83e01e..873d2d0c7a9 100644 --- a/ansible/configs/rhte-lb/pre_infra.yml +++ b/ansible/configs/rhte-lb/pre_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure diff --git a/ansible/configs/rhte-lb/pre_software.yml b/ansible/configs/rhte-lb/pre_software.yml index 4e4fc0a35d6..8d0da6de2aa 100644 --- a/ansible/configs/rhte-lb/pre_software.yml +++ b/ansible/configs/rhte-lb/pre_software.yml @@ -4,29 +4,29 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step003 - generate_env_keys tasks: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{workdir_dir}}/{{env_authorized_key}}" when: set_env_authorized_key - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + path: "{{workdir_dir}}/{{env_authorized_key}}" mode: 0400 when: set_env_authorized_key - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{env_authorized_key}}" > "{{workdir_dir}}/{{env_authorized_key}}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + creates: "{{workdir_dir}}/{{env_authorized_key}}.pub" when: set_env_authorized_key # Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} @@ -35,27 +35,27 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa", when: 'install_ipa_client' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-student-user", when: 'install_student_user' } + - { role: "bastion", when: 'install_bastion' } + - { role: "bastion-opentlc-ipa", when: 'install_ipa_client' } + - { role: "bastion-student-user", when: 'install_student_user' } tags: - step004 - bastion_tasks @@ -65,9 +65,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/rhte-lb/software.yml b/ansible/configs/rhte-lb/software.yml index 42376ce0f56..d44d9e1f7c9 100644 --- a/ansible/configs/rhte-lb/software.yml +++ b/ansible/configs/rhte-lb/software.yml @@ -3,9 +3,9 @@ hosts: localhost gather_facts: False become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tasks: - debug: msg: "Software tasks started" @@ -14,8 +14,8 @@ hosts: bastions gather_facts: false become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Set up Cluster Names fail: diff --git a/ansible/configs/rhte-oc-cluster-vms/README.adoc b/ansible/configs/rhte-oc-cluster-vms/README.adoc index 3803e64f982..3619bb572b2 100644 --- a/ansible/configs/rhte-oc-cluster-vms/README.adoc +++ b/ansible/configs/rhte-oc-cluster-vms/README.adoc @@ -66,7 +66,7 @@ ansible-playbook main.yml \ -e "clientvm_instance_type=t2.large" \ -e "email=name@example.com" \ -e "software_to_deploy=none" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "own_repo_path=${REPO_PATH}" ---- @@ -105,7 +105,7 @@ ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \ -e "software_to_deploy=none" \ -e "osrelease=3.9.14" \ -e "docker_version=1.13.1" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE ---- === To Delete an environment diff --git a/ansible/configs/rhte-oc-cluster-vms/destroy_env.yml b/ansible/configs/rhte-oc-cluster-vms/destroy_env.yml index 888284b9cbb..2b897fd3293 100644 --- a/ansible/configs/rhte-oc-cluster-vms/destroy_env.yml +++ b/ansible/configs/rhte-oc-cluster-vms/destroy_env.yml @@ -4,9 +4,9 @@ connection: local gather_facts: False become: no - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tasks: - debug: diff --git a/ansible/configs/rhte-oc-cluster-vms/post_infra.yml b/ansible/configs/rhte-oc-cluster-vms/post_infra.yml index 75fe98e03e9..900efbb061f 100644 --- a/ansible/configs/rhte-oc-cluster-vms/post_infra.yml +++ b/ansible/configs/rhte-oc-cluster-vms/post_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure diff --git a/ansible/configs/rhte-oc-cluster-vms/post_software.yml b/ansible/configs/rhte-oc-cluster-vms/post_software.yml index 394ce09051c..e8c4ddbc3ed 100644 --- a/ansible/configs/rhte-oc-cluster-vms/post_software.yml +++ b/ansible/configs/rhte-oc-cluster-vms/post_software.yml @@ -3,8 +3,8 @@ hosts: bastions become: yes gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - debug: msg: "Post-Software Steps starting" @@ -152,7 +152,7 @@ ansible-playbook -i localhost, -c local /root/ansible_agnostic_deployer/ansible/configs/ocp-workloads/ocp-workload.yml - -e"ANSIBLE_REPO_PATH=/root/ansible_agnostic_deployer/ansible" + -e"ANSIBLE_REPO_PATH | default('.')=/root/ansible_agnostic_deployer/ansible" -e"ocp_username=developer" -e"ocp_workload={{ item }}" -e"guid=a1001" @@ -169,9 +169,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/rhte-oc-cluster-vms/pre_infra.yml b/ansible/configs/rhte-oc-cluster-vms/pre_infra.yml index 4b0fd83e01e..873d2d0c7a9 100644 --- a/ansible/configs/rhte-oc-cluster-vms/pre_infra.yml +++ b/ansible/configs/rhte-oc-cluster-vms/pre_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure diff --git a/ansible/configs/rhte-oc-cluster-vms/pre_software.yml b/ansible/configs/rhte-oc-cluster-vms/pre_software.yml index 4e4fc0a35d6..8d0da6de2aa 100644 --- a/ansible/configs/rhte-oc-cluster-vms/pre_software.yml +++ b/ansible/configs/rhte-oc-cluster-vms/pre_software.yml @@ -4,29 +4,29 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step003 - generate_env_keys tasks: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{workdir_dir}}/{{env_authorized_key}}" when: set_env_authorized_key - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + path: "{{workdir_dir}}/{{env_authorized_key}}" mode: 0400 when: set_env_authorized_key - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{env_authorized_key}}" > "{{workdir_dir}}/{{env_authorized_key}}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + creates: "{{workdir_dir}}/{{env_authorized_key}}.pub" when: set_env_authorized_key # Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} @@ -35,27 +35,27 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa", when: 'install_ipa_client' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-student-user", when: 'install_student_user' } + - { role: "bastion", when: 'install_bastion' } + - { role: "bastion-opentlc-ipa", when: 'install_ipa_client' } + - { role: "bastion-student-user", when: 'install_student_user' } tags: - step004 - bastion_tasks @@ -65,9 +65,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/rhte-oc-cluster-vms/software.yml b/ansible/configs/rhte-oc-cluster-vms/software.yml index 5d512423da7..668f8dcf99a 100644 --- a/ansible/configs/rhte-oc-cluster-vms/software.yml +++ b/ansible/configs/rhte-oc-cluster-vms/software.yml @@ -3,9 +3,9 @@ hosts: localhost gather_facts: False become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tasks: - debug: msg: "Software tasks started" @@ -14,13 +14,13 @@ hosts: bastions gather_facts: false become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tasks: - name: Set up Client VM include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-client-vm" + name: "ocp-client-vm" - name: Software flight-check hosts: localhost diff --git a/ansible/configs/rhte-ocp-workshop/README.adoc b/ansible/configs/rhte-ocp-workshop/README.adoc index d2f5753d5b4..936e517985e 100644 --- a/ansible/configs/rhte-ocp-workshop/README.adoc +++ b/ansible/configs/rhte-ocp-workshop/README.adoc @@ -69,7 +69,7 @@ ansible-playbook main.yml -e "guid=${GUID}" -e "env_type=${ENVTYPE}" \ -e "nfs_instance_type=m3.large" -e "node_instance_count=5" \ -e "email=name@example.com" \ -e "install_idm=htpasswd" -e "software_to_deploy=openshift" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" -e "own_repo_path=${REPO_PATH}" --skip-tags=remove_self_provisioners + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" -e "own_repo_path=${REPO_PATH}" --skip-tags=remove_self_provisioners ---- @@ -104,7 +104,7 @@ ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \ -e "repo_method=satellite" -e "repo_version=${REPO_VERSION}" \ -e "email=name@example.com" \ -e "software_to_deploy=openshift" -e "osrelease=3.5.5.15" -e "docker_version=1.12.6" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE ---- === Advanced Development Workshop @@ -131,7 +131,7 @@ ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \ -e "nfs_instance_type=t2.large" -e "node_instance_count=${NODE_COUNT}" \ -e "install_idm=htpasswd" -e "software_to_deploy=openshift" \ -e "email=name@example.com" \ - -e "own_repo_path=${REPO_PATH}" -e"repo_method=rhn" -e"ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "own_repo_path=${REPO_PATH}" -e"repo_method=rhn" -e"ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "osrelease=3.5.5.31" -e "repo_version=${REPO_VERSION}" -e "docker_version=1.12.6" \ --skip-tags=remove_self_provisioners,opentlc-integration ---- @@ -170,7 +170,7 @@ REPO_VERSION=3.5 NODE_COUNT=4 NEW_NODE_COUNT=2 ansible-playbook ./configs/${ENVTYPE}/scaleup.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "HostedZoneId=${HOSTZONEID}" \ -e "bastion_instance_type=t2.large" \ -e "cloud_provider=${CLOUDPROVIDER}" \ diff --git a/ansible/configs/rhte-ocp-workshop/destroy_env.yml b/ansible/configs/rhte-ocp-workshop/destroy_env.yml index e94857b97c3..7309396ffad 100644 --- a/ansible/configs/rhte-ocp-workshop/destroy_env.yml +++ b/ansible/configs/rhte-ocp-workshop/destroy_env.yml @@ -4,9 +4,9 @@ connection: local gather_facts: False become: no - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + environment: AWS_ACCESS_KEY_ID: "{{aws_access_key_id}}" AWS_SECRET_ACCESS_KEY: "{{aws_secret_access_key}}" @@ -14,7 +14,7 @@ tasks: - name: Fetch autoscaling name slurp: - src: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.AutoScalingGroupClientVM" + src: "{{workdir_dir}}/{{ env_type }}.{{ guid }}.AutoScalingGroupClientVM" register: asg_r ignore_errors: yes - when: asg_r is succeeded @@ -108,5 +108,5 @@ ignore_errors: yes - name: Import default azure destroy playbook - import_playbook: "{{ANSIBLE_REPO_PATH}}/cloud_providers/azure_destroy_env.yml" + import_playbook: "{{workdir_dir}}/cloud_providers/azure_destroy_env.yml" when: cloud_provider == 'azure' diff --git a/ansible/configs/rhte-ocp-workshop/env_tests.yml b/ansible/configs/rhte-ocp-workshop/env_tests.yml index 9ccce7adbc1..798b77c833a 100644 --- a/ansible/configs/rhte-ocp-workshop/env_tests.yml +++ b/ansible/configs/rhte-ocp-workshop/env_tests.yml @@ -3,7 +3,7 @@ - name: ocp-workshop tests hosts: masters[0] become: yes - vars_files: + - "./{{ env_type }}_vars.yml" - "./{{ env_type }}_secret_vars.yml" diff --git a/ansible/configs/rhte-ocp-workshop/post_infra.yml b/ansible/configs/rhte-ocp-workshop/post_infra.yml index 49d148b5892..238aed6fe43 100644 --- a/ansible/configs/rhte-ocp-workshop/post_infra.yml +++ b/ansible/configs/rhte-ocp-workshop/post_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step002 - post_infrastructure @@ -33,7 +33,7 @@ - name: Write down autoscaling name copy: - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.AutoScalingGroupClientVM" + dest: "{{workdir_dir}}/{{ env_type }}.{{ guid }}.AutoScalingGroupClientVM" content: "{{cloudformation_out_final.stack_outputs.AutoScalingGroupClientVM}}" - name: Allocate and associate an EIP to the clientVMs @@ -43,27 +43,27 @@ with_items: "{{groups['clientvms']}}" register: eips - # reimport roles to update inventory, since publicIP changed + # reimport roles to update inventory, since publicIP changed - name: Run infra-ec2-create-inventory Role import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-ec2-create-inventory" + name: "infra-ec2-create-inventory" - name: Run Common SSH Config Generator Role import_role: - name: "{{ANSIBLE_REPO_PATH}}/roles/infra-common-ssh-config-generate" + name: "infra-common-ssh-config-generate" - name: Create JSON file for DNS records for clientVM vars: DNS_action: UPSERT template: src: ./files/clientvms_dns.json.j2 - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{env_type}}-{{guid}}_clientvms_dns.json" + dest: "{{workdir_dir}}/{{env_type}}-{{guid}}_clientvms_dns.json" - name: Create clientvms DNS names command: >- aws route53 change-resource-record-sets --hosted-zone-id {{HostedZoneId}} - --change-batch file:///{{ANSIBLE_REPO_PATH}}/workdir/{{env_type}}-{{guid}}_clientvms_dns.json + --change-batch file:///{{workdir_dir}}/{{env_type}}-{{guid}}_clientvms_dns.json - name: Rename instance ec2_tag: @@ -115,7 +115,7 @@ - name: write down s3user credentials copy: - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.s3user.credentials" + dest: "{{workdir_dir}}/{{ env_type }}.{{ guid }}.s3user.credentials" content: | * S3 Bucket for registry: {{s3user}} ** S3User access key: {{s3user_access_key}} @@ -136,7 +136,7 @@ - name: write down Route53User credentials copy: - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.route53user.credentials" + dest: "{{workdir_dir}}/{{ env_type }}.{{ guid }}.route53user.credentials" content: | * Route53 User for Let's Encrypt: {{ route53user }} ** Route53User access key: {{ route53user_access_key }} @@ -148,9 +148,9 @@ hosts: support become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tasks: - name: test if docker_device file is present (previous run) stat: @@ -347,9 +347,9 @@ hosts: nodes become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tasks: - name: test if docker_device file is present (previous run) stat: @@ -412,9 +412,9 @@ hosts: infranodes become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tasks: - name: test if docker_device file is present (previous run) stat: @@ -477,9 +477,9 @@ hosts: masters become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tasks: - name: test if docker_device file is present (previous run) stat: diff --git a/ansible/configs/rhte-ocp-workshop/post_software.yml b/ansible/configs/rhte-ocp-workshop/post_software.yml index ae21d511139..65f56c158d7 100644 --- a/ansible/configs/rhte-ocp-workshop/post_software.yml +++ b/ansible/configs/rhte-ocp-workshop/post_software.yml @@ -3,8 +3,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Create user vols shell: "mkdir -p /srv/nfs/user-vols/vol{1..{{user_vols}}}" @@ -16,8 +16,8 @@ run_once: true gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - when: install_nfs|bool block: @@ -32,7 +32,7 @@ - name: Generate PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/pvs.j2" + src: "./files/pvs.j2" dest: "/root/pvs-{{ env_type }}-{{ guid }}.yml" tags: [ gen_pv_file ] when: pv_list.0 is defined @@ -46,7 +46,7 @@ - name: Generate user vol PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/userpvs.j2" + src: "./files/userpvs.j2" dest: "/root/userpvs-{{ env_type }}-{{ guid }}.yml" tags: - gen_user_vol_pv @@ -65,8 +65,8 @@ run_once: true become: yes gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - env-specific_infra @@ -100,10 +100,10 @@ hosts: bastions become: yes gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/mgr_users.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/mgr_users.yml" + + tags: - env-specific - cf_integration @@ -111,7 +111,7 @@ tasks: - name: Configure Bastion include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/opentlc-integration" + name: "opentlc-integration" vars: no_log: yes when: install_opentlc_integration|bool @@ -132,8 +132,8 @@ run_once: true become: yes gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - env-specific_infra @@ -185,8 +185,8 @@ run_once: true become: yes gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: [ env-specific, remove_self_provisioners ] tasks: - when: remove_self_provisioners|bool @@ -209,8 +209,8 @@ hosts: masters gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - project_request @@ -275,8 +275,8 @@ hosts: nodes gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - env_specific_images @@ -291,8 +291,8 @@ run_once: true become: yes gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - env_specific_images @@ -330,8 +330,8 @@ - nodes - infranodes - masters - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - install_nfs @@ -369,8 +369,8 @@ become: yes hosts: masters run_once: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Fix cri-o garbage collection when: @@ -390,14 +390,14 @@ run_once: true gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - install_openwhisk tasks: - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-infra-openwhisk" + name: "ocp-infra-openwhisk" when: - install_openwhisk|d(False)|bool @@ -411,13 +411,13 @@ - infranodes - masters - bastions - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - install_prometheus tasks: - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-infra-prometheus-pre310" + name: "ocp-infra-prometheus-pre310" when: - install_prometheus|d(False)|bool - osrelease is version_compare("3.10", "<") @@ -429,8 +429,8 @@ become: yes hosts: - infranodes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - install_prometheus tasks: @@ -446,8 +446,8 @@ hosts: - bastions run_once: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - install_prometheus tasks: @@ -475,8 +475,8 @@ - nodes - infranodes - masters - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - install_prometheus tasks: @@ -512,12 +512,12 @@ run_once: true gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Customize Service Catalog UI for workshops include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-infra-enable-custom-catalog" + name: "ocp-infra-enable-custom-catalog" when: enable_workshops_catalog|d(False)|bool tags: - env-specific @@ -528,11 +528,11 @@ run_once: true gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-infra-nexus" + name: "ocp-infra-nexus" vars: nexus_project: "{{admin_project}}" when: install_nexus|d(False)|bool @@ -545,14 +545,14 @@ run_once: true gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - install_aws_broker tasks: - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-infra-aws-service-broker" + name: "ocp-infra-aws-service-broker" when: install_aws_broker|d(False)|bool - name: Update Ansible (Automation) Broker to show images from DockerHub @@ -560,15 +560,15 @@ run_once: true gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - install_openshiftapb tasks: - name: Update ASB include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift-ansible-broker" + name: "openshift-ansible-broker" when: install_openshiftapb|d(False)|bool - name: Install Maistra (Istio) @@ -576,15 +576,15 @@ run_once: true gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - install_maistra tasks: - name: Install Maistra include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-infra-maistra" + name: "ocp-infra-maistra" vars: openshift_master_public: "{{ master_lb_dns }}" when: install_maistra|d(False)|bool @@ -596,9 +596,9 @@ gather_facts: false run_once: true become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - infra_workloads tasks: @@ -617,7 +617,7 @@ block: - name: Deploy ocp-infra workloads include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/{{ workload_loop_var }}" + name: "{{ workload_loop_var }}" vars: #admin_user: "{{ admin_user }}" ocp_username: "{{ admin_user }}" @@ -632,9 +632,9 @@ gather_facts: false run_once: true become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - student_workloads tasks: @@ -662,7 +662,7 @@ - name: Deploy ocp-workloads for each user ID include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/{{ workload_loop_var[1] }}" + name: "{{ workload_loop_var[1] }}" vars: ocp_username: "user{{ workload_loop_var[0] }}" ACTION: "provision" @@ -675,20 +675,20 @@ hosts: masters gather_facts: true become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + vars: zabbix_auto_registration_keyword: OCP Master tasks: - when: install_zabbix|bool block: - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client" + name: "zabbix-client" - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client-openshift-master" + name: "zabbix-client-openshift-master" - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client-openshift-node" + name: "zabbix-client-openshift-node" tags: - env-specific - install_zabbix @@ -699,9 +699,9 @@ - infranodes gather_facts: true become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + vars: zabbix_auto_registration_keyword: OCP Node zabbix_token: "{{ hostvars[groups['masters'][0]].zabbix_token }}" @@ -710,9 +710,9 @@ - when: install_zabbix|bool block: - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client" + name: "zabbix-client" - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client-openshift-node" + name: "zabbix-client-openshift-node" tags: - env-specific - install_zabbix @@ -723,15 +723,15 @@ - support gather_facts: true become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + vars: zabbix_auto_registration_keyword: OCP Host tasks: - when: install_zabbix|bool include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client" + name: "zabbix-client" tags: - env-specific - install_zabbix @@ -742,8 +742,8 @@ become: yes gather_facts: False run_once: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - when: - osrelease is version_compare('3.9', '>=') @@ -773,7 +773,7 @@ - name: Fetch the diagnostic archive and logs fetch: src: /tmp/diagnostics.tar.gz - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{project_tag}}_diagnostics.tar.gz" + dest: "{{workdir_dir}}/{{project_tag}}_diagnostics.tar.gz" flat: true - name: Report diagnostics failure @@ -786,12 +786,12 @@ become: yes gather_facts: False run_once: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tasks: - include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool - name: PostSoftware flight-check @@ -799,8 +799,8 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - post_flight_check tasks: @@ -810,8 +810,8 @@ - name: Gather facts hosts: - all - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + gather_facts: true tags: - ocp_report @@ -821,9 +821,9 @@ connection: local become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - ocp_report vars: @@ -832,7 +832,7 @@ - name: get repo version used to deploy command: git rev-parse HEAD args: - chdir: "{{ ANSIBLE_REPO_PATH }}" + chdir: "{{ ANSIBLE_REPO_PATH | default('.') }}" register: ansible_agnostic_deployer_head - name: Gather ec2 facts @@ -848,8 +848,8 @@ - cloud_provider == 'ec2' - name: Generate report template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/ocp_report.adoc.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/ocp_report_{{ env_type }}-{{ guid }}.adoc" + src: "./files/ocp_report.adoc.j2" + dest: "{{workdir_dir}}/ocp_report_{{ env_type }}-{{ guid }}.adoc" when: - ocp_report|bool - cloud_provider == 'ec2' diff --git a/ansible/configs/rhte-ocp-workshop/pre_infra.yml b/ansible/configs/rhte-ocp-workshop/pre_infra.yml index 444cc902a90..129fa387876 100644 --- a/ansible/configs/rhte-ocp-workshop/pre_infra.yml +++ b/ansible/configs/rhte-ocp-workshop/pre_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure diff --git a/ansible/configs/rhte-ocp-workshop/pre_software.yml b/ansible/configs/rhte-ocp-workshop/pre_software.yml index 4b675177af3..d1fa6b8425c 100644 --- a/ansible/configs/rhte-ocp-workshop/pre_software.yml +++ b/ansible/configs/rhte-ocp-workshop/pre_software.yml @@ -4,29 +4,29 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step003 - generate_env_keys tasks: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{workdir_dir}}/{{env_authorized_key}}" when: set_env_authorized_key - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + path: "{{workdir_dir}}/{{env_authorized_key}}" mode: 0400 when: set_env_authorized_key - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{env_authorized_key}}" > "{{workdir_dir}}/{{env_authorized_key}}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + creates: "{{workdir_dir}}/{{env_authorized_key}}.pub" when: set_env_authorized_key # Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} @@ -36,9 +36,9 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks @@ -48,11 +48,11 @@ rhel_repos: "{{ rhel_repos + ['rhel-7-server-ansible-2.4-rpms'] }}" when: osrelease is version_compare('3.9', '>=') roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories" + - role: "set-repositories" when: repo_method is defined - - role: "{{ ANSIBLE_REPO_PATH }}/roles/common" + - role: "common" when: install_common|bool - - role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key" + - role: "set_env_authorized_key" when: set_env_authorized_key|bool - name: Install Let's Encrypt Wildcard Certificates @@ -60,12 +60,12 @@ run_once: true become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Create Let's Encrypt Certificates include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/host-lets-encrypt-certs" + name: "host-lets-encrypt-certs" vars: - acme_domain: "{{ master_lb_dns }}" - acme_wildcard_domain: "*.{{ cloudapps_suffix }}" @@ -73,9 +73,9 @@ - acme_aws_secret_access_key: "{{ hostvars['localhost'].route53user_secret_access_key }}" - acme_production: "{{ lets_encrypt_production|d(False)|bool}}" - acme_remote_dir: "/root" - - acme_cache_cert_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}.cert" - - acme_cache_key_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}.key" - - acme_cache_archive_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}_acme.tgz" + - acme_cache_cert_file: "{{workdir_dir}}/{{guid}}.cert" + - acme_cache_key_file: "{{workdir_dir}}/{{guid}}.key" + - acme_cache_archive_file: "{{workdir_dir}}/{{guid}}_acme.tgz" - acme_renew_automatically: True - acme_force_issue: False when: @@ -85,12 +85,12 @@ hosts: bastions become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-student-user", when: student_password is defined } + - { role: "bastion", when: 'install_bastion' } + - { role: "bastion-student-user", when: student_password is defined } tasks: - name: Populate /etc/hosts with internaldns to relief route53 lineinfile: @@ -104,12 +104,12 @@ hosts: clientvms become: true gather_facts: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-student-user", when: student_password is defined } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-client-vm", when: 'install_clientvm' } + - { role: "bastion-student-user", when: student_password is defined } + - { role: "ocp-client-vm", when: 'install_clientvm' } tags: - step004 - bastion_tasks @@ -120,9 +120,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: @@ -133,8 +133,8 @@ hosts: masters gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - env-specific - project_request diff --git a/ansible/configs/rhte-ocp-workshop/scaleup.yml b/ansible/configs/rhte-ocp-workshop/scaleup.yml index b03441693a8..6b059d08bb0 100644 --- a/ansible/configs/rhte-ocp-workshop/scaleup.yml +++ b/ansible/configs/rhte-ocp-workshop/scaleup.yml @@ -7,7 +7,7 @@ ################################################################################ ################################################################################ -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/pre_infra.yml" +- import_playbook: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/pre_infra.yml" tags: - step000 - pre_infra_tasks @@ -18,7 +18,7 @@ ################################################################################# ################################################################################# -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/cloud_providers/{{ cloud_provider }}_infrastructure_deployment.yml" +- import_playbook: "{{ ANSIBLE_REPO_PATH | default('.') }}/cloud_providers/{{ cloud_provider }}_infrastructure_deployment.yml" tags: - step001 - deploy_infrastructure @@ -28,8 +28,8 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - name: Assert new_node_instance_count and node_instance_count are setup properly. tags: assert_new_node @@ -48,7 +48,7 @@ ################################################################################# ################################################################################# -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/post_infra.yml" +- import_playbook: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/post_infra.yml" tags: - step002 - post_infra_tasks @@ -66,16 +66,16 @@ - "newnodes" become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: PreSoftware flight-check @@ -83,9 +83,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: @@ -98,13 +98,13 @@ gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + hosts: - "newnodes" roles: - - "{{ ANSIBLE_REPO_PATH }}/roles/openshift-node" + - "openshift-node" tags: - openshift_node_tasks @@ -112,23 +112,23 @@ hosts: bastions become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - openshift_host_templates tasks: - - name: generate ansible hosts file, keep it under workdir + - name: generate ansible hosts file, keep it under workdir_dir template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/hosts_template.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/scaleup_hosts-{{ env_type }}-{{ guid }}" + src: "./files/hosts_template.j2" + dest: "{{workdir_dir}}/scaleup_hosts-{{ env_type }}-{{ guid }}" delegate_to: localhost become: false tags: - generate_ansible_hosts_file - name: Copy over ansible hosts file copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/scaleup_hosts-{{ env_type }}-{{ guid }}" + src: "{{workdir_dir}}/scaleup_hosts-{{ env_type }}-{{ guid }}" dest: /etc/ansible/scaleup_hosts ## Run Scaleup playbook @@ -137,8 +137,8 @@ gather_facts: False become: yes hosts: bastions[0] - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - installing_openshift ## Change to scale up, and change inventory file @@ -165,9 +165,9 @@ connection: local become: False gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - generate_ansible_hosts_file tasks: @@ -184,9 +184,9 @@ - name: Remove hosts from group newnodes gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + hosts: newnodes tasks: - group: @@ -198,9 +198,9 @@ hosts: bastions become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - openshift_host_templates tasks: @@ -208,10 +208,10 @@ msg: "WARNING: s3user credentials not set" when: s3user_access_key is not defined - - name: generate ansible hosts file, keep it under workdir + - name: generate ansible hosts file, keep it under workdir_dir template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/hosts_template.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ env_type }}-{{ guid }}" + src: "./files/hosts_template.j2" + dest: "{{workdir_dir}}/hosts-{{ env_type }}-{{ guid }}" delegate_to: localhost become: false tags: @@ -219,6 +219,6 @@ - name: Copy over ansible hosts file copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ project_tag }}" + src: "{{workdir_dir}}/hosts-{{ project_tag }}" dest: /etc/ansible/hosts backup: yes diff --git a/ansible/configs/simple-multi-cloud-example/README.adoc b/ansible/configs/simple-multi-cloud-example/README.adoc index 547bb1aae54..740c08b5ae9 100644 --- a/ansible/configs/simple-multi-cloud-example/README.adoc +++ b/ansible/configs/simple-multi-cloud-example/README.adoc @@ -58,7 +58,7 @@ DEPLOYER_REPO_PATH=`pwd` ansible-playbook \ ${DEPLOYER_REPO_PATH}/main.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" \ -e "env_type=${ENVTYPE}" \ -e "key_name=${KEYNAME}" \ @@ -83,7 +83,7 @@ ENVTYPE="simple-multi-cloud-example" CLOUDPROVIDER=ec2 #To Destroy an Env ansible-playbook ./configs/${ENVTYPE}/destroy_env.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" -e "env_type=${ENVTYPE}" -e "cloud_provider=${CLOUDPROVIDER}" -e "aws_region=${REGION}" \ -e "HostedZoneId=${HOSTZONEID}" -e "key_name=${KEYNAME}" -e "subdomain_base_suffix=${BASESUFFIX}" diff --git a/ansible/configs/simple-multi-cloud-example/destroy_env.yml b/ansible/configs/simple-multi-cloud-example/destroy_env.yml index b4c7ba07743..026083c9de6 100644 --- a/ansible/configs/simple-multi-cloud-example/destroy_env.yml +++ b/ansible/configs/simple-multi-cloud-example/destroy_env.yml @@ -3,17 +3,17 @@ connection: local gather_facts: False become: no - vars_files: - - "{{ANSIBLE_REPO_PATH}}/configs/{{ env_type }}/env_vars.yml" - - "{{ANSIBLE_REPO_PATH}}/configs/{{ env_type }}/env_secret_vars.yml" + + + tasks: - name: Run infra-ec2-template-destroy include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-{{cloud_provider}}-template-destroy" + name: "infra-{{cloud_provider}}-template-destroy" when: cloud_provider == 'ec2' - name: Run infra-azure-template-destroy include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-{{cloud_provider}}-template-destroy" + name: "infra-{{cloud_provider}}-template-destroy" when: cloud_provider == 'azure' diff --git a/ansible/configs/simple-multi-cloud-example/env_vars.yml b/ansible/configs/simple-multi-cloud-example/env_vars.yml index 6b1f9375dde..4640475926a 100644 --- a/ansible/configs/simple-multi-cloud-example/env_vars.yml +++ b/ansible/configs/simple-multi-cloud-example/env_vars.yml @@ -109,7 +109,7 @@ software_to_deploy: none ###V2WORK, these should just be set as default listed in the documentation # This is where the ssh_config file will be created, this file is used to # define the communication method to all the hosts in the deployment -deploy_local_ssh_config_location: "{{ANSIBLE_REPO_PATH}}/workdir" +deploy_local_ssh_config_location: "{{workdir_dir}}/" ### If you want a Key Pair name created and injected into the hosts, diff --git a/ansible/configs/simple-multi-cloud-example/post_infra.yml b/ansible/configs/simple-multi-cloud-example/post_infra.yml index cb74cb0897c..a4e7362ed19 100644 --- a/ansible/configs/simple-multi-cloud-example/post_infra.yml +++ b/ansible/configs/simple-multi-cloud-example/post_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure diff --git a/ansible/configs/simple-multi-cloud-example/post_software.yml b/ansible/configs/simple-multi-cloud-example/post_software.yml index 2b419864371..ddaa7fc1aa7 100644 --- a/ansible/configs/simple-multi-cloud-example/post_software.yml +++ b/ansible/configs/simple-multi-cloud-example/post_software.yml @@ -2,8 +2,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - debug: msg: "Post-Software tasks Started" @@ -14,11 +14,11 @@ become: yes tags: - opentlc_bastion_tasks - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool # sssd bug, fixed by restart @@ -33,9 +33,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/simple-multi-cloud-example/pre_infra.yml b/ansible/configs/simple-multi-cloud-example/pre_infra.yml index 90178ba789a..f53897e59e2 100644 --- a/ansible/configs/simple-multi-cloud-example/pre_infra.yml +++ b/ansible/configs/simple-multi-cloud-example/pre_infra.yml @@ -3,9 +3,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -15,19 +15,19 @@ msg: "Step 000 Pre Infrastructure" - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{workdir_dir}}/{{env_authorized_key}}" when: set_env_authorized_key - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + path: "{{workdir_dir}}/{{env_authorized_key}}" mode: 0400 when: set_env_authorized_key - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{env_authorized_key}}" > "{{workdir_dir}}/{{env_authorized_key}}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + creates: "{{workdir_dir}}/{{env_authorized_key}}.pub" when: set_env_authorized_key diff --git a/ansible/configs/simple-multi-cloud-example/pre_software.yml b/ansible/configs/simple-multi-cloud-example/pre_software.yml index 1ac16bec2d3..ebf39240942 100644 --- a/ansible/configs/simple-multi-cloud-example/pre_software.yml +++ b/ansible/configs/simple-multi-cloud-example/pre_software.yml @@ -5,25 +5,25 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } + - { role: "bastion", when: 'install_bastion' } tags: - step004 - bastion_tasks @@ -34,9 +34,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/configs/three-tier-app/README.adoc b/ansible/configs/three-tier-app/README.adoc index 602bd6f3b45..dae532b6328 100644 --- a/ansible/configs/three-tier-app/README.adoc +++ b/ansible/configs/three-tier-app/README.adoc @@ -58,7 +58,7 @@ DEPLOYER_REPO_PATH=`pwd` ansible-playbook \ ${DEPLOYER_REPO_PATH}/main.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" \ -e "env_type=${ENVTYPE}" \ -e "key_name=${KEYNAME}" \ @@ -85,7 +85,7 @@ ENVTYPE="three-tier-app" CLOUDPROVIDER=ec2 #To Destroy an Env ansible-playbook ./configs/${ENVTYPE}/destroy_env.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" -e "env_type=${ENVTYPE}" -e "cloud_provider=${CLOUDPROVIDER}" -e "aws_region=${REGION}" \ -e "HostedZoneId=${HOSTZONEID}" -e "key_name=${KEYNAME}" -e "subdomain_base_suffix=${BASESUFFIX}" diff --git a/ansible/configs/three-tier-app/destroy_env.yml b/ansible/configs/three-tier-app/destroy_env.yml index 4d37b2696a8..54114c2c91e 100644 --- a/ansible/configs/three-tier-app/destroy_env.yml +++ b/ansible/configs/three-tier-app/destroy_env.yml @@ -1,3 +1,3 @@ --- - name: Import default destroy playbook - import_playbook: "{{ANSIBLE_REPO_PATH}}/cloud_providers/{{cloud_provider}}_destroy_env.yml" + import_playbook: "{{workdir_dir}}/cloud_providers/{{cloud_provider}}_destroy_env.yml" diff --git a/ansible/configs/three-tier-app/env_vars.yml b/ansible/configs/three-tier-app/env_vars.yml index ffab1970ac0..2376ba6d9fe 100644 --- a/ansible/configs/three-tier-app/env_vars.yml +++ b/ansible/configs/three-tier-app/env_vars.yml @@ -35,7 +35,7 @@ project_tag: "{{ env_type }}-{{ guid }}" # This is where the ssh_config file will be created, this file is used to # define the communication method to all the hosts in the deployment -deploy_local_ssh_config_location: "{{ANSIBLE_REPO_PATH}}/workdir" +deploy_local_ssh_config_location: "{{workdir_dir}}/" install_bastion: true install_common: true diff --git a/ansible/configs/three-tier-app/post_infra.yml b/ansible/configs/three-tier-app/post_infra.yml index cb74cb0897c..a4e7362ed19 100644 --- a/ansible/configs/three-tier-app/post_infra.yml +++ b/ansible/configs/three-tier-app/post_infra.yml @@ -2,9 +2,9 @@ hosts: localhost connection: local become: false - vars_files: - - "./env_vars.yml" - - "./env_secret_vars.yml" + + + tags: - step002 - post_infrastructure diff --git a/ansible/configs/three-tier-app/post_software.yml b/ansible/configs/three-tier-app/post_software.yml index 2b419864371..ddaa7fc1aa7 100644 --- a/ansible/configs/three-tier-app/post_software.yml +++ b/ansible/configs/three-tier-app/post_software.yml @@ -2,8 +2,8 @@ hosts: support gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - debug: msg: "Post-Software tasks Started" @@ -14,11 +14,11 @@ become: yes tags: - opentlc_bastion_tasks - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tasks: - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool # sssd bug, fixed by restart @@ -33,9 +33,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - post_flight_check tasks: diff --git a/ansible/configs/three-tier-app/pre_infra.yml b/ansible/configs/three-tier-app/pre_infra.yml index 90178ba789a..f53897e59e2 100644 --- a/ansible/configs/three-tier-app/pre_infra.yml +++ b/ansible/configs/three-tier-app/pre_infra.yml @@ -3,9 +3,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step001 - pre_infrastructure @@ -15,19 +15,19 @@ msg: "Step 000 Pre Infrastructure" - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{workdir_dir}}/{{env_authorized_key}}" when: set_env_authorized_key - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + path: "{{workdir_dir}}/{{env_authorized_key}}" mode: 0400 when: set_env_authorized_key - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{env_authorized_key}}" > "{{workdir_dir}}/{{env_authorized_key}}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + creates: "{{workdir_dir}}/{{env_authorized_key}}.pub" when: set_env_authorized_key diff --git a/ansible/configs/three-tier-app/pre_software.yml b/ansible/configs/three-tier-app/pre_software.yml index 1ac16bec2d3..0a7e8221c1b 100644 --- a/ansible/configs/three-tier-app/pre_software.yml +++ b/ansible/configs/three-tier-app/pre_software.yml @@ -5,25 +5,25 @@ - all:!windows become: true gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } + - { role: "bastion", when: 'install_bastion' } tags: - step004 - bastion_tasks @@ -34,9 +34,9 @@ connection: local gather_facts: false become: false - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - flight_check tasks: diff --git a/ansible/destroy.yml b/ansible/destroy.yml index 466b654120b..4b37d61b481 100644 --- a/ansible/destroy.yml +++ b/ansible/destroy.yml @@ -16,4 +16,4 @@ - when: cloud_provider == 'ec2' include_tasks: cloud_providers/ec2_detect_region_tasks.yml -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/destroy_env.yml" +- import_playbook: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/destroy_env.yml" diff --git a/ansible/include_vars.yml b/ansible/include_vars.yml index e1ba8b0b982..f0bfe5100c4 100644 --- a/ansible/include_vars.yml +++ b/ansible/include_vars.yml @@ -21,3 +21,7 @@ loop: "{{ rstat_varfiles.results }}" loop_control: label: "{{ item._ansible_item_label | default(item) }}" + - name: Set ANSIBLE_REPO_PATH + set_fact: + ANSIBLE_REPO_PATH: "{{playbook_dir}}" + WORKDIR: "{{workdir_dir}}" diff --git a/ansible/install_galaxy_roles.yml b/ansible/install_galaxy_roles.yml index 6611d01180a..31b54957b3e 100644 --- a/ansible/install_galaxy_roles.yml +++ b/ansible/install_galaxy_roles.yml @@ -7,7 +7,7 @@ vars: # User can override this variable to specify a different requirements.yml, like: # -e requirements_path=.../requirements_prod.yml - requirements_path: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/requirements.yml" + requirements_path: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/requirements.yml" tasks: - name: Check if requirements.yml exists @@ -19,5 +19,5 @@ command: >- ansible-galaxy install -r "{{ requirements_path }}" - -p "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/roles" + -p "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/roles" when: r_requirements_stat.stat.exists diff --git a/ansible/main.yml b/ansible/main.yml index 97e71088001..e7e8e0554ec 100644 --- a/ansible/main.yml +++ b/ansible/main.yml @@ -22,7 +22,7 @@ ################################################################################ ################################################################################ -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/pre_infra.yml" +- import_playbook: "./configs/{{ env_type }}/pre_infra.yml" tags: - step000 - pre_infra_tasks @@ -33,7 +33,7 @@ ################################################################################# ################################################################################# -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/cloud_providers/{{ cloud_provider }}_infrastructure_deployment.yml" +- import_playbook: "./cloud_providers/{{ cloud_provider }}_infrastructure_deployment.yml" tags: - step001 - deploy_infrastructure @@ -47,7 +47,7 @@ ################################################################################ ################################################################################ -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/post_infra.yml" +- import_playbook: "./configs/{{ env_type }}/post_infra.yml" tags: - step002 - post_infra_tasks @@ -59,7 +59,7 @@ ################################################################################ - name: Pre Software - import_playbook: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/pre_software.yml" + import_playbook: "./configs/{{ env_type }}/pre_software.yml" tags: - step003 - pre_software_tasks @@ -71,12 +71,12 @@ ################################################################################## - name: Software - import_playbook: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/software.yml" + import_playbook: "./configs/{{ env_type }}/software.yml" tags: - step004 - deploy_software -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/software_playbooks/{{ software_to_deploy }}.yml" +- import_playbook: "./software_playbooks/{{ software_to_deploy }}.yml" tags: - step004 - deploy_software @@ -87,7 +87,7 @@ ################################################################################ ################################################################################ -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/post_software.yml" +- import_playbook: "./configs/{{ env_type }}/post_software.yml" tags: - step005 - post_software diff --git a/ansible/roles/archived_roles/nodejs/README.md b/ansible/roles/archived_roles/nodejs/README.md index ff14d4321aa..be239c36dbc 100644 --- a/ansible/roles/archived_roles/nodejs/README.md +++ b/ansible/roles/archived_roles/nodejs/README.md @@ -51,7 +51,7 @@ None. ## Example Playbook - hosts: utility - vars_files: + - vars/main.yml roles: - geerlingguy.nodejs diff --git a/ansible/roles/archived_roles/repositories/tasks/main.yml b/ansible/roles/archived_roles/repositories/tasks/main.yml index 6c754fd7ca4..02b911c57e0 100644 --- a/ansible/roles/archived_roles/repositories/tasks/main.yml +++ b/ansible/roles/archived_roles/repositories/tasks/main.yml @@ -39,7 +39,7 @@ - name: create open.repo template on host template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/repos_template.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/repos_template.j2" dest: /etc/yum.repos.d/open_{{ env_type }}.repo tags: - create_open_repo_template diff --git a/ansible/roles/bastion-opentlc-ipa/tasks/main.yml b/ansible/roles/bastion-opentlc-ipa/tasks/main.yml index 35b2ef0e80a..44d65c87ac9 100644 --- a/ansible/roles/bastion-opentlc-ipa/tasks/main.yml +++ b/ansible/roles/bastion-opentlc-ipa/tasks/main.yml @@ -82,7 +82,7 @@ - name: Fetch the ipa-client-logs archive fetch: src: /tmp/ipa-client-logs.tar.gz - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{project_tag}}_ipa-client-logs.tar.gz" + dest: "{{workdir_dir}}/{{project_tag}}_ipa-client-logs.tar.gz" flat: true ignore_errors: yes diff --git a/ansible/roles/bastion/tasks/main.yml b/ansible/roles/bastion/tasks/main.yml index 5f0ea3715ca..225daa5684d 100644 --- a/ansible/roles/bastion/tasks/main.yml +++ b/ansible/roles/bastion/tasks/main.yml @@ -14,7 +14,7 @@ - name: copy the environment .pem key become: true copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" + src: "{{workdir_dir}}/{{ env_authorized_key }}" dest: /root/.ssh/{{env_authorized_key}}.pem owner: root group: root @@ -35,14 +35,14 @@ - name: Generate host .ssh/config Template become: no - local_action: template src={{ role_path }}/files/bastion_ssh_config.j2 dest={{ ANSIBLE_REPO_PATH }}/workdir/ssh-config-{{ env_type }}-{{ guid }} + local_action: template src={{ role_path }}/files/bastion_ssh_config.j2 dest={{workdir_dir}}/ssh-config-{{ env_type }}-{{ guid }} tags: - gen_sshconfig_file - name: copy over host .ssh/config Template become: true copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/ssh-config-{{ env_type }}-{{ guid }}" + src: "{{workdir_dir}}/ssh-config-{{ env_type }}-{{ guid }}" dest: /root/.ssh/config owner: root group: root diff --git a/ansible/roles/common/tasks/use_own_repos.yml b/ansible/roles/common/tasks/use_own_repos.yml index a3a0b96b48b..b534781955d 100644 --- a/ansible/roles/common/tasks/use_own_repos.yml +++ b/ansible/roles/common/tasks/use_own_repos.yml @@ -21,7 +21,7 @@ - name: create open.repo template on host template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/repos_template.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/repos_template.j2" dest: /etc/yum.repos.d/open_{{ env_type }}.repo tags: - create_open_repo_template diff --git a/ansible/roles/geerlingguy.gogs/README.md b/ansible/roles/geerlingguy.gogs/README.md index ca2c41a6a6d..76d578fdb6a 100644 --- a/ansible/roles/geerlingguy.gogs/README.md +++ b/ansible/roles/geerlingguy.gogs/README.md @@ -41,7 +41,7 @@ MySQL database support. Set `gogs_use_mysql` to `true` to configure MySQL for go ## Example Playbook - hosts: servers - vars_files: + - vars/main.yml roles: - geerlingguy.gogs diff --git a/ansible/roles/host-ocp-installer/tasks/main.yml b/ansible/roles/host-ocp-installer/tasks/main.yml index 160a1de82c1..eb2e66c3620 100644 --- a/ansible/roles/host-ocp-installer/tasks/main.yml +++ b/ansible/roles/host-ocp-installer/tasks/main.yml @@ -41,7 +41,7 @@ - name: Fetch ansible.log (3.7 and earlier) fetch: src: /root/ansible.log - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{project_tag}}.bastion.ansible.log" + dest: "{{workdir_dir}}/{{project_tag}}.bastion.ansible.log" flat: true tags: - openshift_installer @@ -80,7 +80,7 @@ - name: Fetch ansible.log for prerequisites run (3.9 and later) fetch: src: /root/ansible.log - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{project_tag}}.bastion.ansible.prerequisites.log" + dest: "{{workdir_dir}}/{{project_tag}}.bastion.ansible.prerequisites.log" flat: true tags: - openshift_installer @@ -119,7 +119,7 @@ - name: Fetch ansible.log for deploy_cluster run (3.9 and later) fetch: src: /root/ansible.log - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{project_tag}}.bastion.ansible.deploy_cluster.log" + dest: "{{workdir_dir}}/{{project_tag}}.bastion.ansible.deploy_cluster.log" flat: true tags: - openshift_installer diff --git a/ansible/roles/host-ocp-provisioner/tasks/main.yml b/ansible/roles/host-ocp-provisioner/tasks/main.yml index 4b820b4f918..2c20c397ed7 100644 --- a/ansible/roles/host-ocp-provisioner/tasks/main.yml +++ b/ansible/roles/host-ocp-provisioner/tasks/main.yml @@ -7,7 +7,7 @@ - name: Copy over ansible hosts file copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ env_type }}-{{ guid }}" + src: "{{workdir_dir}}/hosts-{{ env_type }}-{{ guid }}" dest: /etc/ansible/hosts - name: get idm certificate @@ -64,7 +64,7 @@ - name: Generate htpasswd file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{env_type}}/files/htpasswd.openshift" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{env_type}}/files/htpasswd.openshift" dest: /root/htpasswd.openshift - name: Install Host packages for releases before 3.10 diff --git a/ansible/roles/infra-azure-template-destroy/tasks/main.yml b/ansible/roles/infra-azure-template-destroy/tasks/main.yml index 20ee935724d..af39ba803da 100644 --- a/ansible/roles/infra-azure-template-destroy/tasks/main.yml +++ b/ansible/roles/infra-azure-template-destroy/tasks/main.yml @@ -59,7 +59,7 @@ AZURE_CONFIG_DIR: "/tmp/.azure-{{project_tag}}" block: - set_fact: - t_dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.{{cloud_provider}}_cloud_template" + t_dest: "{{workdir_dir}}/{{ env_type }}.{{ guid }}.{{cloud_provider}}_cloud_template" - name: Get all resources from the deployment command: az group deployment show --name {{env_type}}.{{guid}} --resource-group {{az_resource_group}} diff --git a/ansible/roles/infra-common-ssh-config-generate/tasks/main.yml b/ansible/roles/infra-common-ssh-config-generate/tasks/main.yml index 42c2a57a7f8..51d15eaf366 100644 --- a/ansible/roles/infra-common-ssh-config-generate/tasks/main.yml +++ b/ansible/roles/infra-common-ssh-config-generate/tasks/main.yml @@ -12,8 +12,8 @@ bastion_hostname: "{{groups['bastions'].0 }}" # This is where the ssh_config file will be created, this file is used to # define the communication method to all the hosts in the deployment - ansible_ssh_config: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" - ansible_known_host: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_known_hosts" + ansible_ssh_config: "{{workdir_dir}}/{{ env_type }}_{{ guid }}_ssh_conf" + ansible_known_host: "{{workdir_dir}}/{{ env_type }}_{{ guid }}_ssh_known_hosts" remote_user: "{{ remote_user_map[cloud_provider] }}" - name: Delete dedicated known_host if it exists (new deployment) diff --git a/ansible/roles/infra-ec2-template-create/tasks/main.yml b/ansible/roles/infra-ec2-template-create/tasks/main.yml index 0ab6aadc833..8edaf2295d8 100644 --- a/ansible/roles/infra-ec2-template-create/tasks/main.yml +++ b/ansible/roles/infra-ec2-template-create/tasks/main.yml @@ -29,7 +29,7 @@ - name: Regenerate the CloudFormation template because of custom images include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/infra-ec2-template-generate" + name: "infra-ec2-template-generate" when: - amifacts is defined - amifacts is not skipped @@ -45,7 +45,7 @@ region: "{{ aws_region_loop | d(aws_region) | d(region) | d('us-east-1')}}" # rollback is unreliable, it can make this task hang forever. disable_rollback: true - template: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.{{cloud_provider}}_cloud_template" + template: "{{workdir_dir}}/{{ env_type }}.{{ guid }}.{{cloud_provider}}_cloud_template" tags: "{{ cf_tags | combine(cloud_tags_final)}}" tags: - aws_infrastructure_deployment diff --git a/ansible/roles/infra-ec2-template-generate/tasks/locate_template.yml b/ansible/roles/infra-ec2-template-generate/tasks/locate_template.yml index 2525c0da279..93de30ded47 100644 --- a/ansible/roles/infra-ec2-template-generate/tasks/locate_template.yml +++ b/ansible/roles/infra-ec2-template-generate/tasks/locate_template.yml @@ -1,12 +1,12 @@ --- - name: Check if template exists for the environment stat: - path: "{{ANSIBLE_REPO_PATH}}/configs/{{ env_type }}/files/cloud_providers/{{cloud_provider}}_cloud_template.j2" + path: "{{ANSIBLE_REPO_PATH | default('.')}}/configs/{{ env_type }}/files/cloud_providers/{{cloud_provider}}_cloud_template.j2" register: stat_local_template - name: Use CloudFormation template from the environment set_fact: - cloudformation_template_src: "{{ANSIBLE_REPO_PATH}}/configs/{{ env_type }}/files/cloud_providers/{{cloud_provider}}_cloud_template.j2" + cloudformation_template_src: "{{ANSIBLE_REPO_PATH | default('.')}}/configs/{{ env_type }}/files/cloud_providers/{{cloud_provider}}_cloud_template.j2" when: stat_local_template.stat.exists - name: Use the default CloudFormation template diff --git a/ansible/roles/infra-ec2-template-generate/tasks/main.yml b/ansible/roles/infra-ec2-template-generate/tasks/main.yml index d5facf172ee..8552026744e 100644 --- a/ansible/roles/infra-ec2-template-generate/tasks/main.yml +++ b/ansible/roles/infra-ec2-template-generate/tasks/main.yml @@ -2,7 +2,7 @@ - import_tasks: locate_template.yml - set_fact: - cloudformation_template: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.{{cloud_provider}}_cloud_template" + cloudformation_template: "{{workdir_dir}}/{{ env_type }}.{{ guid }}.{{cloud_provider}}_cloud_template" - name: AWS Generate CloudFormation Template template: diff --git a/ansible/roles/infra-local-create-ssh_key/tasks/main.yml b/ansible/roles/infra-local-create-ssh_key/tasks/main.yml index 99f76090cf2..85afdc84263 100644 --- a/ansible/roles/infra-local-create-ssh_key/tasks/main.yml +++ b/ansible/roles/infra-local-create-ssh_key/tasks/main.yml @@ -1,18 +1,18 @@ --- - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{workdir_dir}}/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{workdir_dir}}/{{env_authorized_key}}" when: set_env_authorized_key | bool - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + path: "{{workdir_dir}}/{{env_authorized_key}}" mode: 0400 when: set_env_authorized_key | bool - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + shell: ssh-keygen -y -f "{{workdir_dir}}/{{env_authorized_key}}" > "{{workdir_dir}}/{{env_authorized_key}}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + creates: "{{workdir_dir}}/{{env_authorized_key}}.pub" when: set_env_authorized_key | bool diff --git a/ansible/roles/ocp-client-vm/README.md b/ansible/roles/ocp-client-vm/README.md index a68b9d3264a..bb16e044b88 100644 --- a/ansible/roles/ocp-client-vm/README.md +++ b/ansible/roles/ocp-client-vm/README.md @@ -50,7 +50,7 @@ WORKLOAD="ocp-client-vm" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USERNAME}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"ACTION=create" diff --git a/ansible/roles/ocp-dynamic-nfs-provisioner/README.md b/ansible/roles/ocp-dynamic-nfs-provisioner/README.md index 35e6a133f5e..edb90bddb44 100644 --- a/ansible/roles/ocp-dynamic-nfs-provisioner/README.md +++ b/ansible/roles/ocp-dynamic-nfs-provisioner/README.md @@ -43,7 +43,7 @@ Example Playbook tasks: - name: Set up Dynamic NFS Provisioning include_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-dynamic-nfs-provisioner" + name: "ocp-dynamic-nfs-provisioner" vars: nfs_provisioner_nfs_server_hostname: "support.GUID.internal" nfs_provisioner_storage_class_is_default: True diff --git a/ansible/roles/ocp-infra-aws-service-broker/README.md b/ansible/roles/ocp-infra-aws-service-broker/README.md index 09d5b9890a0..306b39d35a4 100644 --- a/ansible/roles/ocp-infra-aws-service-broker/README.md +++ b/ansible/roles/ocp-infra-aws-service-broker/README.md @@ -27,11 +27,11 @@ Example Playbook hosts: masters gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + run_once: true roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/aws-broker" } + - { role: "aws-broker" } License ------- diff --git a/ansible/roles/ocp-infra-nexus/README.md b/ansible/roles/ocp-infra-nexus/README.md index 90e8b96088b..ff4b1175d7b 100644 --- a/ansible/roles/ocp-infra-nexus/README.md +++ b/ansible/roles/ocp-infra-nexus/README.md @@ -30,4 +30,4 @@ Example Playbook - hosts: masters run_once: true roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-infra-nexus", nexus_project: "sonatype-nexus" } + - { role: "ocp-infra-nexus", nexus_project: "sonatype-nexus" } diff --git a/ansible/roles/ocp-infra-openwhisk/README.md b/ansible/roles/ocp-infra-openwhisk/README.md index 652c733e106..a574d765af1 100644 --- a/ansible/roles/ocp-infra-openwhisk/README.md +++ b/ansible/roles/ocp-infra-openwhisk/README.md @@ -25,10 +25,10 @@ Example Playbook run_once: true gather_facts: False become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/openwhisk" } + - { role: "openwhisk" } License ------- diff --git a/ansible/roles/ocp-workload-3scale-demo/readme.adoc b/ansible/roles/ocp-workload-3scale-demo/readme.adoc index 152a18ba542..819747887c7 100644 --- a/ansible/roles/ocp-workload-3scale-demo/readme.adoc +++ b/ansible/roles/ocp-workload-3scale-demo/readme.adoc @@ -79,7 +79,7 @@ bastion.cluster4.openshift.opentlc.com tags: - step007 roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/{{ocp_workload}}", when: 'ocp_workload is defined' } + - { role: "{{ocp_workload}}", when: 'ocp_workload is defined' } ---- NOTE: You might want to change `hosts: all` to fit your requirements @@ -96,7 +96,7 @@ GUID=0418 ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/id_rsa" \ -e"ansible_ssh_user=opentlc-mgr" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -117,7 +117,7 @@ GUID=3005 ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/id_rsa" \ -e"ansible_ssh_user=opentlc-mgr" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-3scale-experienced/readme.adoc b/ansible/roles/ocp-workload-3scale-experienced/readme.adoc index 3e161e0f537..7cee99bc372 100644 --- a/ansible/roles/ocp-workload-3scale-experienced/readme.adoc +++ b/ansible/roles/ocp-workload-3scale-experienced/readme.adoc @@ -8,13 +8,13 @@ This workload only sets a clusterquota for a student who has need to provision a GUID=user1 WORKLOAD="ocp-workload-3scale-experienced" ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ -e"ACTION=create" ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ -e"ACTION=remove" diff --git a/ansible/roles/ocp-workload-3scale-lifecycle/readme.adoc b/ansible/roles/ocp-workload-3scale-lifecycle/readme.adoc index 1c72e163170..967bf2aaf92 100644 --- a/ansible/roles/ocp-workload-3scale-lifecycle/readme.adoc +++ b/ansible/roles/ocp-workload-3scale-lifecycle/readme.adoc @@ -6,7 +6,7 @@ SUBDOMAIN_BASE=`oc whoami --show-server | cut -d'.' -f 2,3,4,5 | cut -d':' -f 1` # API manager provision ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"ACTION=create" \ -e"subdomain_base=$SUBDOMAIN_BASE" @@ -14,7 +14,7 @@ ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"ACTION=remove" \ -e"subdomain_base=$SUBDOMAIN_BASE" diff --git a/ansible/roles/ocp-workload-3scale-multitenant/readme.adoc b/ansible/roles/ocp-workload-3scale-multitenant/readme.adoc index fc9c81db9bb..3e0e922ff20 100644 --- a/ansible/roles/ocp-workload-3scale-multitenant/readme.adoc +++ b/ansible/roles/ocp-workload-3scale-multitenant/readme.adoc @@ -31,7 +31,7 @@ ADM_USERNAME=api0 # API manager provision ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"ACTION=create" \ -e"subdomain_base=$SUBDOMAIN_BASE" \ @@ -45,7 +45,7 @@ CREATE_GWS_WITH_EACH_TENANT=true # Tenant Management ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"ACTION=tenant_mgmt" \ -e"start_tenant=$START_TENANT" \ @@ -58,7 +58,7 @@ ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml # Delete REMOVE_TENANTS_ONLY=true ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"ACTION=remove" \ -e"subdomain_base=$SUBDOMAIN_BASE" \ diff --git a/ansible/roles/ocp-workload-amq-enmasse/readme.adoc b/ansible/roles/ocp-workload-amq-enmasse/readme.adoc index 1e82f59a5ea..12f82d45434 100644 --- a/ansible/roles/ocp-workload-amq-enmasse/readme.adoc +++ b/ansible/roles/ocp-workload-amq-enmasse/readme.adoc @@ -37,7 +37,7 @@ SSH_PRIVATE_KEY="id_ocp" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USERNAME}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -62,7 +62,7 @@ SSH_PRIVATE_KEY="id_ocp" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USERNAME}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-appdev-homework/readme.adoc b/ansible/roles/ocp-workload-appdev-homework/readme.adoc index aff7ea06f77..f4c2599d6c9 100644 --- a/ansible/roles/ocp-workload-appdev-homework/readme.adoc +++ b/ansible/roles/ocp-workload-appdev-homework/readme.adoc @@ -40,7 +40,7 @@ GUID=1001 ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/keytoyourhost.pem" \ -e"ansible_ssh_user=ec2-user" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -60,7 +60,7 @@ GUID=1002 ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/keytoyourhost.pem" \ -e"ansible_ssh_user=ec2-user" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -80,7 +80,7 @@ ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ tags: - step007 roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/{{ocp_workload}}", when: 'ocp_workload is defined' } + - { role: "{{ocp_workload}}", when: 'ocp_workload is defined' } ---- NOTE: You might want to change `hosts: all` to fit your requirements diff --git a/ansible/roles/ocp-workload-appmod-migration/ilt_provision.sh b/ansible/roles/ocp-workload-appmod-migration/ilt_provision.sh index bb21361af5f..c87af0c4f71 100755 --- a/ansible/roles/ocp-workload-appmod-migration/ilt_provision.sh +++ b/ansible/roles/ocp-workload-appmod-migration/ilt_provision.sh @@ -60,7 +60,7 @@ function executeAnsibleViaLocalhost() { echo -en "\n\nexecuteAnsibleViaLocalhost(): Provisioning project with GUID = $GUID and OCP_USERNAME = $OCP_USERNAME\n" >> $LOG_FILE ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-appmod-migration/readme.adoc b/ansible/roles/ocp-workload-appmod-migration/readme.adoc index 4b82e4afe33..1aaa9244c95 100644 --- a/ansible/roles/ocp-workload-appmod-migration/readme.adoc +++ b/ansible/roles/ocp-workload-appmod-migration/readme.adoc @@ -7,7 +7,7 @@ WORKLOAD="ocp-workload-appmod-migration" GUID=1 OCP_USERNAME="user$GUID" ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -15,7 +15,7 @@ ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml -e"ACTION=create" ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-bxms-dm/ilt_provision.sh b/ansible/roles/ocp-workload-bxms-dm/ilt_provision.sh index 143e11f2dff..e221bcfc7e7 100755 --- a/ansible/roles/ocp-workload-bxms-dm/ilt_provision.sh +++ b/ansible/roles/ocp-workload-bxms-dm/ilt_provision.sh @@ -79,7 +79,7 @@ function executeAnsible() { ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USERNAME}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-bxms-dm/readme.adoc b/ansible/roles/ocp-workload-bxms-dm/readme.adoc index 08a9110d532..5d843b27ff8 100644 --- a/ansible/roles/ocp-workload-bxms-dm/readme.adoc +++ b/ansible/roles/ocp-workload-bxms-dm/readme.adoc @@ -15,7 +15,7 @@ OCP_USERNAME="jbride-redhat.com" # a TARGET_HOST is specified in the command line, without using an inventory file ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ -e"ACTION=create" \ @@ -29,7 +29,7 @@ ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml # a TARGET_HOST is specified in the command line, without using an inventory file ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-bxms-pam/ilt_provision.sh b/ansible/roles/ocp-workload-bxms-pam/ilt_provision.sh index 8186bdf6e0b..fdd6dba53ab 100755 --- a/ansible/roles/ocp-workload-bxms-pam/ilt_provision.sh +++ b/ansible/roles/ocp-workload-bxms-pam/ilt_provision.sh @@ -74,7 +74,7 @@ function executeAnsible() { ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USERNAME}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-bxms-pam/readme.adoc b/ansible/roles/ocp-workload-bxms-pam/readme.adoc index ca59a29d141..5045192febe 100644 --- a/ansible/roles/ocp-workload-bxms-pam/readme.adoc +++ b/ansible/roles/ocp-workload-bxms-pam/readme.adoc @@ -11,7 +11,7 @@ WORKLOAD="ocp-workload-bxms-pam" GUID=jb45 ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"ocp_user_needs_quota=true" \ -e"guid=$GUID" \ @@ -19,7 +19,7 @@ ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml -e"ocp_username=dtorresf-redhat.com" ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=$GUID" \ -e"ACTION=remove" \ diff --git a/ansible/roles/ocp-workload-developer-environment/readme.adoc b/ansible/roles/ocp-workload-developer-environment/readme.adoc index aff7ea06f77..f4c2599d6c9 100644 --- a/ansible/roles/ocp-workload-developer-environment/readme.adoc +++ b/ansible/roles/ocp-workload-developer-environment/readme.adoc @@ -40,7 +40,7 @@ GUID=1001 ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/keytoyourhost.pem" \ -e"ansible_ssh_user=ec2-user" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -60,7 +60,7 @@ GUID=1002 ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/keytoyourhost.pem" \ -e"ansible_ssh_user=ec2-user" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -80,7 +80,7 @@ ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ tags: - step007 roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/{{ocp_workload}}", when: 'ocp_workload is defined' } + - { role: "{{ocp_workload}}", when: 'ocp_workload is defined' } ---- NOTE: You might want to change `hosts: all` to fit your requirements diff --git a/ansible/roles/ocp-workload-dm7-qlb-demo/readme.adoc b/ansible/roles/ocp-workload-dm7-qlb-demo/readme.adoc index c34207fcdc8..45135680605 100644 --- a/ansible/roles/ocp-workload-dm7-qlb-demo/readme.adoc +++ b/ansible/roles/ocp-workload-dm7-qlb-demo/readme.adoc @@ -40,7 +40,7 @@ tags: - step007 roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/{{ocp_workload}}", when: 'ocp_workload is defined' } + - { role: "{{ocp_workload}}", when: 'ocp_workload is defined' } ---- NOTE: You might want to change `hosts: all` to fit your requirements @@ -67,7 +67,7 @@ WORKLOAD="ocp-workload-fsi-client-onboarding-demo" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USER}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -87,7 +87,7 @@ WORKLOAD="ocp-workload-fsi-client-onboarding-demo" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USER}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-example/readme.adoc b/ansible/roles/ocp-workload-example/readme.adoc index 25ba94df95b..4259b908d1a 100644 --- a/ansible/roles/ocp-workload-example/readme.adoc +++ b/ansible/roles/ocp-workload-example/readme.adoc @@ -41,7 +41,7 @@ GUID=1001 ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/keytoyourhost.pem" \ -e"ansible_ssh_user=ec2-user" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"silent=False" \ @@ -61,7 +61,7 @@ GUID=1002 ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/keytoyourhost.pem" \ -e"ansible_ssh_user=ec2-user" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -82,7 +82,7 @@ ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ tags: - step007 roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/{{ocp_workload}}", when: 'ocp_workload is defined' } + - { role: "{{ocp_workload}}", when: 'ocp_workload is defined' } ---- NOTE: You might want to change `hosts: all` to fit your requirements diff --git a/ansible/roles/ocp-workload-fsi-client-onboarding-demo/readme.adoc b/ansible/roles/ocp-workload-fsi-client-onboarding-demo/readme.adoc index c34207fcdc8..45135680605 100644 --- a/ansible/roles/ocp-workload-fsi-client-onboarding-demo/readme.adoc +++ b/ansible/roles/ocp-workload-fsi-client-onboarding-demo/readme.adoc @@ -40,7 +40,7 @@ tags: - step007 roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/{{ocp_workload}}", when: 'ocp_workload is defined' } + - { role: "{{ocp_workload}}", when: 'ocp_workload is defined' } ---- NOTE: You might want to change `hosts: all` to fit your requirements @@ -67,7 +67,7 @@ WORKLOAD="ocp-workload-fsi-client-onboarding-demo" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USER}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -87,7 +87,7 @@ WORKLOAD="ocp-workload-fsi-client-onboarding-demo" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USER}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-fuse-ignite/ilt_provision.sh b/ansible/roles/ocp-workload-fuse-ignite/ilt_provision.sh index cf7482fdbcb..95c4afe6635 100644 --- a/ansible/roles/ocp-workload-fuse-ignite/ilt_provision.sh +++ b/ansible/roles/ocp-workload-fuse-ignite/ilt_provision.sh @@ -73,7 +73,7 @@ function executeAnsibleViaLocalhost() { echo -en "\n\nexecuteAnsibleViaLocalhost(): Provisioning project with GUID = $GUID and OCP_USERNAME = $OCP_USERNAME\n" >> $LOG_FILE ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-fuse-on-ocp/ilt_provision.sh b/ansible/roles/ocp-workload-fuse-on-ocp/ilt_provision.sh index 88ede2de306..1ef5ae9fa8e 100755 --- a/ansible/roles/ocp-workload-fuse-on-ocp/ilt_provision.sh +++ b/ansible/roles/ocp-workload-fuse-on-ocp/ilt_provision.sh @@ -75,7 +75,7 @@ function executeAnsible() { ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USERNAME}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-fuse-on-ocp/readme.adoc b/ansible/roles/ocp-workload-fuse-on-ocp/readme.adoc index ace2562ab1d..539a99ad534 100644 --- a/ansible/roles/ocp-workload-fuse-on-ocp/readme.adoc +++ b/ansible/roles/ocp-workload-fuse-on-ocp/readme.adoc @@ -15,7 +15,7 @@ OCP_USERNAME="jbride-redhat.com" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USERNAME}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -36,7 +36,7 @@ OCP_USERNAME="jbride-redhat.com" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USERNAME}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-integreatly/readme.adoc b/ansible/roles/ocp-workload-integreatly/readme.adoc index 4c17631cc63..68ce8cc4720 100644 --- a/ansible/roles/ocp-workload-integreatly/readme.adoc +++ b/ansible/roles/ocp-workload-integreatly/readme.adoc @@ -41,7 +41,7 @@ tags: - step007 roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/{{ocp_workload}}", when: 'ocp_workload is defined' } + - { role: "{{ocp_workload}}", when: 'ocp_workload is defined' } ---- NOTE: You might want to change `hosts: all` to fit your requirements @@ -68,7 +68,7 @@ WORKLOAD="ocp-workload-integreatly" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USER}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ -e"ocp_user_needs_quota=false" \ @@ -85,7 +85,7 @@ WORKLOAD="ocp-workload-integreatly" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USER}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ -e"ACTION=remove" diff --git a/ansible/roles/ocp-workload-iot-demo/readme.adoc b/ansible/roles/ocp-workload-iot-demo/readme.adoc index f81a96d2aea..aa597f7c2f1 100644 --- a/ansible/roles/ocp-workload-iot-demo/readme.adoc +++ b/ansible/roles/ocp-workload-iot-demo/readme.adoc @@ -40,7 +40,7 @@ tags: - step007 roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/{{ocp_workload}}", when: 'ocp_workload is defined' } + - { role: "{{ocp_workload}}", when: 'ocp_workload is defined' } ---- NOTE: You might want to change `hosts: all` to fit your requirements @@ -70,7 +70,7 @@ WORKLOAD="ocp-workload-parksmap-demo" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USER}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -90,7 +90,7 @@ WORKLOAD="ocp-workload-parksmap-demo" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USER}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-istio-community/readme.adoc b/ansible/roles/ocp-workload-istio-community/readme.adoc index a403d65149e..46f6867fb20 100644 --- a/ansible/roles/ocp-workload-istio-community/readme.adoc +++ b/ansible/roles/ocp-workload-istio-community/readme.adoc @@ -15,12 +15,12 @@ WORKLOAD="ocp-workload-istio-community" ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"ACTION=create" ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"ACTION=remove" diff --git a/ansible/roles/ocp-workload-pam-order-it-hardware/readme.adoc b/ansible/roles/ocp-workload-pam-order-it-hardware/readme.adoc index c34207fcdc8..45135680605 100644 --- a/ansible/roles/ocp-workload-pam-order-it-hardware/readme.adoc +++ b/ansible/roles/ocp-workload-pam-order-it-hardware/readme.adoc @@ -40,7 +40,7 @@ tags: - step007 roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/{{ocp_workload}}", when: 'ocp_workload is defined' } + - { role: "{{ocp_workload}}", when: 'ocp_workload is defined' } ---- NOTE: You might want to change `hosts: all` to fit your requirements @@ -67,7 +67,7 @@ WORKLOAD="ocp-workload-fsi-client-onboarding-demo" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USER}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -87,7 +87,7 @@ WORKLOAD="ocp-workload-fsi-client-onboarding-demo" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USER}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-parksmap-demo/readme.adoc b/ansible/roles/ocp-workload-parksmap-demo/readme.adoc index 1c68468bf84..5ddfee75300 100644 --- a/ansible/roles/ocp-workload-parksmap-demo/readme.adoc +++ b/ansible/roles/ocp-workload-parksmap-demo/readme.adoc @@ -40,7 +40,7 @@ tags: - step007 roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/{{ocp_workload}}", when: 'ocp_workload is defined' } + - { role: "{{ocp_workload}}", when: 'ocp_workload is defined' } ---- NOTE: You might want to change `hosts: all` to fit your requirements @@ -67,7 +67,7 @@ WORKLOAD="ocp-workload-parksmap-demo" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USER}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -87,7 +87,7 @@ WORKLOAD="ocp-workload-parksmap-demo" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USER}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-parksmap-demo/tasks/workload.yml b/ansible/roles/ocp-workload-parksmap-demo/tasks/workload.yml index 067bbe12e53..20a2b523abd 100644 --- a/ansible/roles/ocp-workload-parksmap-demo/tasks/workload.yml +++ b/ansible/roles/ocp-workload-parksmap-demo/tasks/workload.yml @@ -48,7 +48,7 @@ gogs_hostname: "gogs-{{ ocp_project_completed }}.{{ ocp_apps_domain }}" - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/openshift_gogs" + name: "openshift_gogs" vars: project_name: "{{ ocp_project_completed }}" gogs_route: "{{ gogs_hostname }}" diff --git a/ansible/roles/ocp-workload-rhte-mw-api-biz/readme.adoc b/ansible/roles/ocp-workload-rhte-mw-api-biz/readme.adoc index 0128739739a..0193196eaa9 100644 --- a/ansible/roles/ocp-workload-rhte-mw-api-biz/readme.adoc +++ b/ansible/roles/ocp-workload-rhte-mw-api-biz/readme.adoc @@ -40,7 +40,7 @@ SUBDOMAIN_BASE=`oc whoami --show-server | cut -d'.' -f 2,3,4,5 | cut -d':' -f 1` # API manager provision ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"ACTION=create" \ -e"subdomain_base=$SUBDOMAIN_BASE" @@ -53,7 +53,7 @@ END_TENANT=1 # Tenant Management ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"ACTION=tenant_mgmt" \ -e"start_tenant=$START_TENANT" \ @@ -64,7 +64,7 @@ ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml # Delete REMOVE_TENANTS_ONLY=true ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"ACTION=remove" \ -e"subdomain_base=$SUBDOMAIN_BASE" \ diff --git a/ansible/roles/ocp-workload-rhte-mw-api-mesh/ilt_provision.sh b/ansible/roles/ocp-workload-rhte-mw-api-mesh/ilt_provision.sh index 731e6f1ca9b..5c65daee458 100755 --- a/ansible/roles/ocp-workload-rhte-mw-api-mesh/ilt_provision.sh +++ b/ansible/roles/ocp-workload-rhte-mw-api-mesh/ilt_provision.sh @@ -72,7 +72,7 @@ function executeAnsibleViaLocalhost() { echo -en "\n\nexecuteAnsibleViaLocalhost(): Provisioning project with GUID = $GUID and OCP_USERNAME = $OCP_USERNAME\n" >> $LOG_FILE ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-rhte-mw-api-mesh/readme.adoc b/ansible/roles/ocp-workload-rhte-mw-api-mesh/readme.adoc index 844f5e634e6..7f4750a0312 100644 --- a/ansible/roles/ocp-workload-rhte-mw-api-mesh/readme.adoc +++ b/ansible/roles/ocp-workload-rhte-mw-api-mesh/readme.adoc @@ -12,14 +12,14 @@ WORKLOAD="ocp-workload-rhte-mw-api-mesh" GUID=a1001 OCP_USERNAME="developer" ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ -e"ACTION=create" ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-rhte-mw-bfield-migration/readme.adoc b/ansible/roles/ocp-workload-rhte-mw-bfield-migration/readme.adoc index 1f011993d90..87911751590 100644 --- a/ansible/roles/ocp-workload-rhte-mw-bfield-migration/readme.adoc +++ b/ansible/roles/ocp-workload-rhte-mw-bfield-migration/readme.adoc @@ -6,13 +6,13 @@ WORKLOAD="ocp-workload-rhte-mw-bfield-migration" OCP_USERNAME="user1" ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"ACTION=create" ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"ACTION=remove" diff --git a/ansible/roles/ocp-workload-rhte-mw-msa-mesh/readme.adoc b/ansible/roles/ocp-workload-rhte-mw-msa-mesh/readme.adoc index 5a82bc8a234..f4d023e2a87 100644 --- a/ansible/roles/ocp-workload-rhte-mw-msa-mesh/readme.adoc +++ b/ansible/roles/ocp-workload-rhte-mw-msa-mesh/readme.adoc @@ -13,7 +13,7 @@ GUID=1 OCP_USERNAME="user$GUID" HOST_GUID=`oc whoami --show-server | cut -d'.' -f 2` ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -21,7 +21,7 @@ ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml -e"ACTION=create" ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -46,7 +46,7 @@ SSH_PRIVATE_KEY="id_ocp" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USERNAME}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -70,7 +70,7 @@ SSH_PRIVATE_KEY="id_ocp" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USERNAME}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-rhte-mw-msa-orchestration/ilt_provision.sh b/ansible/roles/ocp-workload-rhte-mw-msa-orchestration/ilt_provision.sh index de67feb4849..1872d2cb88d 100755 --- a/ansible/roles/ocp-workload-rhte-mw-msa-orchestration/ilt_provision.sh +++ b/ansible/roles/ocp-workload-rhte-mw-msa-orchestration/ilt_provision.sh @@ -71,7 +71,7 @@ function executeAnsibleViaLocalhost() { echo -en "\n\nexecuteAnsibleViaLocalhost(): Provisioning project with GUID = $GUID and OCP_USERNAME = $OCP_USERNAME\n" >> $LOG_FILE ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-rhte-mw-msa-orchestration/readme.adoc b/ansible/roles/ocp-workload-rhte-mw-msa-orchestration/readme.adoc index f4dea4bee5c..b92b28fb9cd 100644 --- a/ansible/roles/ocp-workload-rhte-mw-msa-orchestration/readme.adoc +++ b/ansible/roles/ocp-workload-rhte-mw-msa-orchestration/readme.adoc @@ -15,7 +15,7 @@ OCP_DOMAIN=$REGION.openshift.opentlc.com # a TARGET_HOST is specified in the command line, without using an inventory file ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -26,7 +26,7 @@ ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/ocp-workload-rhte-mw-op-intel/readme.adoc b/ansible/roles/ocp-workload-rhte-mw-op-intel/readme.adoc index c9a30d43d00..1f8490138e6 100644 --- a/ansible/roles/ocp-workload-rhte-mw-op-intel/readme.adoc +++ b/ansible/roles/ocp-workload-rhte-mw-op-intel/readme.adoc @@ -11,7 +11,7 @@ OCP_USERNAME="jbride-redhat.com" WORKLOAD="ocp-workload-rhte-mw-op-intel" $ ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ACTION=create" @@ -19,7 +19,7 @@ $ ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.y $ ansible-playbook -i localhost, -c local ./configs/ocp-workloads/ocp-workload.yml \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_workload=${WORKLOAD}" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ACTION=remove" diff --git a/ansible/roles/ocp-workload-starter-workshop/readme.adoc b/ansible/roles/ocp-workload-starter-workshop/readme.adoc index 0fc0b963226..4e827f7ce57 100644 --- a/ansible/roles/ocp-workload-starter-workshop/readme.adoc +++ b/ansible/roles/ocp-workload-starter-workshop/readme.adoc @@ -40,7 +40,7 @@ tags: - step007 roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/{{ocp_workload}}", when: 'ocp_workload is defined' } + - { role: "{{ocp_workload}}", when: 'ocp_workload is defined' } ---- NOTE: You might want to change `hosts: all` to fit your requirements @@ -75,7 +75,7 @@ WORKLOAD="ocp-workload-starter-workshop" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USER}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -99,7 +99,7 @@ WORKLOAD="ocp-workload-starter-workshop" ansible-playbook -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USER}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"admin_project=${WORKSHOP_PROJECT}" \ diff --git a/ansible/roles/ocp-workload-vertx-reactica/readme.adoc b/ansible/roles/ocp-workload-vertx-reactica/readme.adoc index 72a190c169c..3dec703c615 100644 --- a/ansible/roles/ocp-workload-vertx-reactica/readme.adoc +++ b/ansible/roles/ocp-workload-vertx-reactica/readme.adoc @@ -29,7 +29,7 @@ WORKLOAD="ocp-workload-vertx-reactica" ansible-playbook -v -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USER}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ @@ -60,7 +60,7 @@ WORKLOAD="ocp-workload-vertx-reactica" ansible-playbook -v -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \ -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \ -e"ansible_ssh_user=${SSH_USER}" \ - -e"ANSIBLE_REPO_PATH=`pwd`" \ + -e"ANSIBLE_REPO_PATH | default('.')=`pwd`" \ -e"ocp_username=${OCP_USERNAME}" \ -e"ocp_workload=${WORKLOAD}" \ -e"guid=${GUID}" \ diff --git a/ansible/roles/set-repositories/tasks/file-repos.yml b/ansible/roles/set-repositories/tasks/file-repos.yml index da8b0d110ea..d416678caf9 100644 --- a/ansible/roles/set-repositories/tasks/file-repos.yml +++ b/ansible/roles/set-repositories/tasks/file-repos.yml @@ -26,7 +26,7 @@ - name: create open.repo template on host template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/repos_template.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/repos_template.j2" dest: /etc/yum.repos.d/open_{{ env_type }}.repo tags: - create_open_repo_template diff --git a/ansible/roles/set_env_authorized_key/tasks/main.yml b/ansible/roles/set_env_authorized_key/tasks/main.yml index 7d7c74d6133..e38d7946a1d 100644 --- a/ansible/roles/set_env_authorized_key/tasks/main.yml +++ b/ansible/roles/set_env_authorized_key/tasks/main.yml @@ -9,7 +9,7 @@ - name: copy the environment .pem key become: true copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}" + src: "{{workdir_dir}}/{{ env_authorized_key }}" dest: "/root/.ssh/{{env_authorized_key}}.pem" owner: root group: root @@ -20,16 +20,16 @@ authorized_key: user: "{{ansible_ssh_user}}" state: present - key: "{{ lookup('file', '{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub') }}" + key: "{{ lookup('file', '{{workdir_dir}}/{{env_authorized_key}}.pub') }}" - name: Generate host .ssh/config Template become: no - local_action: template src={{ role_path }}/files/host_ssh_config.j2 dest={{ ANSIBLE_REPO_PATH }}/workdir/ssh-config-{{ env_type }}-{{ guid }} + local_action: template src={{ role_path }}/files/host_ssh_config.j2 dest={{workdir_dir}}/ssh-config-{{ env_type }}-{{ guid }} - name: copy over host .ssh/config Template become: true copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/ssh-config-{{ env_type }}-{{ guid }}" + src: "{{workdir_dir}}/ssh-config-{{ env_type }}-{{ guid }}" dest: /root/.ssh/config owner: root group: root diff --git a/ansible/roles/tower_demo/tasks/main.yml b/ansible/roles/tower_demo/tasks/main.yml index e6c1c7aa1df..77cc506138e 100644 --- a/ansible/roles/tower_demo/tasks/main.yml +++ b/ansible/roles/tower_demo/tasks/main.yml @@ -10,24 +10,24 @@ - name: Configure the tower cli file template: - src: "{{ ANSIBLE_REPO_PATH }}/files/tower_cli.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/files/tower_cli.j2" dest: "~/.tower_cli.cfg" mode: 0640 - name: copy the license file copy: - src: "{{ ANSIBLE_REPO_PATH }}/files/tower_license" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/files/tower_license" dest: "/tmp/tower_license" - name: copy the private key copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ guid + 'key' }}" + src: "{{workdir_dir}}/{{ guid + 'key' }}" dest: /tmp/id_rsa mode: 0640 - name: generate ansible hosts file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/hosts_template.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/hosts_template.j2" dest: "/etc/ansible/hosts" - name: Add the license of tower diff --git a/ansible/roles/zabbix-client-openshift-master/README.adoc b/ansible/roles/zabbix-client-openshift-master/README.adoc index ff90cdc4289..cef47d5f1e7 100644 --- a/ansible/roles/zabbix-client-openshift-master/README.adoc +++ b/ansible/roles/zabbix-client-openshift-master/README.adoc @@ -16,11 +16,11 @@ In this role: hosts: "{{ ('tag_' ~ env_type ~ '_' ~ guid ~ '_master') | replace('-', '_') }}" gather_facts: true become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client-openshift-master" } + - { role: "zabbix-client-openshift-master" } tags: - env-specific - install_zabbix diff --git a/ansible/roles/zabbix-client-openshift-node/README.adoc b/ansible/roles/zabbix-client-openshift-node/README.adoc index 65c983ab269..a5515026d92 100644 --- a/ansible/roles/zabbix-client-openshift-node/README.adoc +++ b/ansible/roles/zabbix-client-openshift-node/README.adoc @@ -28,14 +28,14 @@ Those variables can either be manually set, or automatically fetched with *zabbi - "{{ ('tag_' ~ env_type ~ '_' ~ guid ~ '_master') | replace('-', '_') }}" gather_facts: true become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + vars: zabbix_token: "{{ hostvars[groups[('tag_' ~ env_type ~ '_' ~ guid ~ '_master') | replace('-', '_')][0]].zabbix_token }}" hawkular_route: "{{ hostvars[groups[('tag_' ~ env_type ~ '_' ~ guid ~ '_master') | replace('-', '_')][0]].hawkular_route }}" roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client-openshift-node" } + - { role: "zabbix-client-openshift-node" } tags: - env-specific - install_zabbix diff --git a/ansible/roles/zabbix-client/README.adoc b/ansible/roles/zabbix-client/README.adoc index db56cf4474e..f2e131317b8 100644 --- a/ansible/roles/zabbix-client/README.adoc +++ b/ansible/roles/zabbix-client/README.adoc @@ -45,16 +45,16 @@ For more information, see https://www.zabbix.com/documentation/3.2/manual/discov - "{{ ('tag_' ~ env_type ~ '_' ~ guid ~ '_infranode') | replace('-', '_') }}" gather_facts: true become: yes - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + vars: zabbix_auto_registration_keyword: OCP Node #pass variable should be setup in env_secret_vars.yml: #zabbix_auto_registration_pass: PASS_SETUP_IN_ZABBIX_ACTIONS zabbix_hostname: "OCP {{ repo_version }} {{ guid }} - {{ ansible_hostname }}" roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client" } + - { role: "zabbix-client" } tags: - env-specific - install_zabbix diff --git a/ansible/software_playbooks/archive/hello_motd.yml b/ansible/software_playbooks/archive/hello_motd.yml deleted file mode 100644 index a3eca2be354..00000000000 --- a/ansible/software_playbooks/archive/hello_motd.yml +++ /dev/null @@ -1,76 +0,0 @@ -#set ft=ansible ---- -- name: get the default ip of localhost - hosts: localhost - tasks: - - debug: - var: ansible_default_ipv4.address - -- name: Test access to bastion by setting motd - hosts: bastion_host - remote_user: cloud-user - become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tasks: - - name: bastion ansible_host - debug: - var: ansible_host - - name: bastion ip - debug: - var: ansible_default_ipv4.address - - copy: - content: "Welcome to Bastion. We hope you enjoy your stay.\n" - dest: /etc/motd - register: motd_changed - until: motd_changed | success - retries: 3 - delay: 25 - - debug: - var: ansible_host - - -- name: Test access to www1 by setting motd - hosts: www1-REPL.rhpds.opentlc.com - remote_user: cloud-user - become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tasks: - - name: www1 ansible_host - debug: - var: ansible_host - - name: www1 ip - debug: - var: ansible_default_ipv4.address - - copy: - content: "Welcome to www1. Please be seated. Your server will be with you shortly.\n" - dest: /etc/motd - register: motd2_changed - until: motd2_changed | success - retries: 3 - delay: 25 - -- name: Test access to www2 by setting motd - hosts: www2-REPL.rhpds.opentlc.com - remote_user: cloud-user - become: true - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" - tasks: - - name: www2 ansible_host - debug: - var: ansible_host - - name: www2 ip - debug: - var: ansible_default_ipv4.address - - copy: - content: "Welcome to www2. Please be seated. Your server will be with you shortly.\n" - dest: /etc/motd - register: motd3_changed - until: motd3_changed | success - retries: 3 - delay: 25 diff --git a/ansible/software_playbooks/none.yml b/ansible/software_playbooks/none.yml index fafeed8ee39..9bbed59b6d7 100644 --- a/ansible/software_playbooks/none.yml +++ b/ansible/software_playbooks/none.yml @@ -16,7 +16,7 @@ - name: generate ansible hosts file template: src: "../configs/{{ env_type }}/files/hosts_template.j2" - dest: "../workdir/hosts-{{ env_type }}-{{ guid }}" + dest: "{{workdir_dir}}/hosts-{{ env_type }}-{{ guid }}" - name: Step 00xxxxx bastion preparation for deployment hosts: bastions @@ -29,5 +29,5 @@ state: directory - name: Copy over ansible hosts file copy: - src: "{{ANSIBLE_REPO_PATH}}/workdir/hosts-{{ env_type }}-{{ guid }}" + src: "{{workdir_dir}}/hosts-{{ env_type }}-{{ guid }}" dest: /etc/ansible/hosts diff --git a/ansible/software_playbooks/openshift.yml b/ansible/software_playbooks/openshift.yml index f1671db2078..c21ac31433d 100644 --- a/ansible/software_playbooks/openshift.yml +++ b/ansible/software_playbooks/openshift.yml @@ -5,9 +5,9 @@ connection: local become: False gather_facts: False - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - generate_ansible_hosts_file - step004 @@ -23,20 +23,20 @@ - name: generate ansible hosts file for 3.7 and earlier template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/hosts_template.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ env_type }}-{{ guid }}" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/hosts_template.j2" + dest: "{{workdir_dir}}/hosts-{{ env_type }}-{{ guid }}" when: - osrelease is version_compare('3.9', '<') - name: generate ansible hosts file for 3.9 and later template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/hosts_template.{{ osrelease }}.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ env_type }}-{{ guid }}" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/hosts_template.{{ osrelease }}.j2" + dest: "{{workdir_dir}}/hosts-{{ env_type }}-{{ guid }}" when: - osrelease is version_compare('3.9', '>=') - name: remove filename parameter from htpasswd authentication for 3.10+ replace: - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ env_type }}-{{ guid }}" + dest: "{{workdir_dir}}/hosts-{{ env_type }}-{{ guid }}" regexp: ', "filename": "/etc/origin/master/htpasswd"' replace: '' when: @@ -54,10 +54,10 @@ - nodes - infranodes - masters - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + roles: - - "{{ ANSIBLE_REPO_PATH }}/roles/host-ocp-node" + - "host-ocp-node" tags: - openshift_node_tasks - step004 @@ -68,10 +68,10 @@ become: yes hosts: - support - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/host-ocp-node" + - role: "host-ocp-node" when: install_glusterfs|d(false)|bool tags: - openshift_node_tasks @@ -86,10 +86,10 @@ order: sorted hosts: - support - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/host-ocp-nfs", when: 'install_nfs' } + - { role: "host-ocp-nfs", when: 'install_nfs' } tags: - nfs_tasks - step004 @@ -102,16 +102,16 @@ become: yes hosts: - bastions - vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + + tags: - installing_openshift - step004 - step004.5 tasks: roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/host-ocp-provisioner" - - role: "{{ ANSIBLE_REPO_PATH }}/roles/host-ocp-installer" + - role: "host-ocp-provisioner" + - role: "host-ocp-installer" post_tasks: - name: get openshift credentials file diff --git a/ansible/software_playbooks/tower.yml b/ansible/software_playbooks/tower.yml index 2279bc717db..e6356addb8c 100644 --- a/ansible/software_playbooks/tower.yml +++ b/ansible/software_playbooks/tower.yml @@ -5,28 +5,28 @@ connection: local become: False gather_facts: False - vars_files: - - "../configs/{{ env_type }}/env_vars.yml" - - "../configs/{{ env_type }}/env_secret_vars.yml" + + + tags: - generate_ansible_hosts_file tasks: - name: generate ansible hosts file template: src: "../configs/{{ env_type }}/files/hosts_template.j2" - dest: "../workdir/hosts-{{ env_type }}-{{ guid }}" + dest: "{{workdir_dir}}/hosts-{{ env_type }}-{{ guid }}" - name: generate ansible tower hosts file template: src: "../configs/{{ env_type }}/files/tower_hosts_template.j2" - dest: "../workdir/tower_hosts-{{ env_type }}-{{ guid }}" + dest: "{{workdir_dir}}/tower_hosts-{{ env_type }}-{{ guid }}" - name: Prepare bastion for Tower Deployment hosts: bastions become: true gather_facts: False - vars_files: - - "../configs/{{ env_type }}/env_vars.yml" - - "../configs/{{ env_type }}/env_secret_vars.yml" + + + vars: tower_inventory_path: /root/tower_hosts @@ -40,12 +40,12 @@ - name: Copy over ansible hosts file copy: - src: "../workdir/hosts-{{ env_type }}-{{ guid }}" + src: "{{workdir_dir}}/hosts-{{ env_type }}-{{ guid }}" dest: /etc/ansible/hosts - name: Copy over ansible tower hosts file copy: - src: "../workdir/tower_hosts-{{ env_type }}-{{ guid }}" + src: "{{workdir_dir}}/tower_hosts-{{ env_type }}-{{ guid }}" dest: "{{tower_inventory_path}}" - name: unarchive the latest tower software unarchive: @@ -82,9 +82,9 @@ hosts: towers[0] become: true gather_facts: False - vars_files: - - "../configs/{{ env_type }}/env_vars.yml" - - "../configs/{{ env_type }}/env_secret_vars.yml" + + + vars: tower_inventory_path: /root/tower_hosts @@ -112,7 +112,7 @@ - name: Configure the tower cli file template: - src: "{{ ANSIBLE_REPO_PATH }}/files/tower_cli.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/tower_cli.j2" dest: "~/.tower_cli.cfg" mode: 0640 - name: Download Licence file diff --git a/ansible/cloud_providers/archive/launch-inventory-sync.yml b/tools/archive/cloudproviders/archive/launch-inventory-sync.yml similarity index 100% rename from ansible/cloud_providers/archive/launch-inventory-sync.yml rename to tools/archive/cloudproviders/archive/launch-inventory-sync.yml diff --git a/ansible/cloud_providers/archive/ravello/delete_application.yml b/tools/archive/cloudproviders/archive/ravello/delete_application.yml similarity index 74% rename from ansible/cloud_providers/archive/ravello/delete_application.yml rename to tools/archive/cloudproviders/archive/ravello/delete_application.yml index 0bfe634454c..19eec94b5ad 100644 --- a/ansible/cloud_providers/archive/ravello/delete_application.yml +++ b/tools/archive/cloudproviders/archive/ravello/delete_application.yml @@ -2,8 +2,8 @@ --- - hosts: localhost vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tasks: - name: 'Waiting for Ravello to unlock the APP for deletion, and deleting.' local_action: diff --git a/ansible/cloud_providers/archive/ravello/save_environment.yml b/tools/archive/cloudproviders/archive/ravello/save_environment.yml similarity index 68% rename from ansible/cloud_providers/archive/ravello/save_environment.yml rename to tools/archive/cloudproviders/archive/ravello/save_environment.yml index f82a6876074..224082e2bfb 100644 --- a/ansible/cloud_providers/archive/ravello/save_environment.yml +++ b/tools/archive/cloudproviders/archive/ravello/save_environment.yml @@ -2,8 +2,8 @@ --- - hosts: localhost vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tasks: - local_action: module: ravello_app diff --git a/ansible/cloud_providers/archive/ravello/ssh_env_keygen.yml b/tools/archive/cloudproviders/archive/ravello/ssh_env_keygen.yml similarity index 60% rename from ansible/cloud_providers/archive/ravello/ssh_env_keygen.yml rename to tools/archive/cloudproviders/archive/ravello/ssh_env_keygen.yml index dde9b355766..950df7bb5cd 100644 --- a/ansible/cloud_providers/archive/ravello/ssh_env_keygen.yml +++ b/tools/archive/cloudproviders/archive/ravello/ssh_env_keygen.yml @@ -6,16 +6,16 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - step003 - generate_env_keys tasks: - name: Generate SSH keys - shell: 'ssh-keygen -b 2048 -t rsa -f {{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}} -q -N ""' + shell: 'ssh-keygen -b 2048 -t rsa -f {{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}} -q -N ""' args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" when: set_env_authorized_key - local_action: command whoami register: my_login @@ -25,4 +25,4 @@ my_login_domain: '{{ my_login.stdout_lines.0 }}@{{ my_domain.stdout_lines.0 }}' - name: save ssh_keys as facts set_fact: - env_public_key: "{{ lookup('file', '{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}.pub') | regex_replace(' ' + my_login_domain, '') }}" + env_public_key: "{{ lookup('file', '{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{ env_authorized_key }}.pub') | regex_replace(' ' + my_login_domain, '') }}" diff --git a/ansible/cloud_providers/archive/ravello_infrastructure_deployment.yml b/tools/archive/cloudproviders/archive/ravello_infrastructure_deployment.yml similarity index 78% rename from ansible/cloud_providers/archive/ravello_infrastructure_deployment.yml rename to tools/archive/cloudproviders/archive/ravello_infrastructure_deployment.yml index ec5b09d65b6..7ac25cf2b82 100644 --- a/ansible/cloud_providers/archive/ravello_infrastructure_deployment.yml +++ b/tools/archive/cloudproviders/archive/ravello_infrastructure_deployment.yml @@ -5,16 +5,16 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - step001 - deploy_infrastructure tasks: - name: Generate Ravello Template template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/cloud_providers/{{cloud_provider}}_cloud_template.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/{{cloud_provider}}_cloud_template.{{ env_type }}.{{ guid }}.template" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/cloud_providers/{{cloud_provider}}_cloud_template.j2" + dest: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{cloud_provider}}_cloud_template.{{ env_type }}.{{ guid }}.template" tags: - ravello_infrastructure_deployment - gen_rav_template @@ -33,7 +33,7 @@ module: ravello_app app_name: "{{ blueprint_name }}" description: "{{ blueprint_description }}" - app_template: "{{ ANSIBLE_REPO_PATH }}/workdir/{{cloud_provider}}_cloud_template.{{ env_type }}.{{ guid }}.template" + app_template: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{cloud_provider}}_cloud_template.{{ env_type }}.{{ guid }}.template" state: design register: design_results tags: @@ -94,7 +94,7 @@ ######################### Update the inventory # - name: Refresh cloud_provider cache -# shell: "{{ ANSIBLE_REPO_PATH }}/inventory/{{ cloud_provider }}.py --list {{ app_results.app_name }}" +# shell: "{{ ANSIBLE_REPO_PATH | default('.') }}/inventory/{{ cloud_provider }}.py --list {{ app_results.app_name }}" # when: "not tower_run == 'true'" # register: task_result # until: task_result.rc == 0 @@ -114,7 +114,7 @@ ######################### Update the inventory - name: Refresh cloud_provider cache - shell: "{{ ANSIBLE_REPO_PATH }}/inventory/{{ cloud_provider }}.py --list {{ app_results.app_name }}" + shell: "{{ ANSIBLE_REPO_PATH | default('.') }}/inventory/{{ cloud_provider }}.py --list {{ app_results.app_name }}" when: "not tower_run == 'true'" register: task_result until: task_result.rc == 0 @@ -131,7 +131,7 @@ - refresh_inventory - copy: content: '{{ task_result.stdout }}' - dest: '{{ ANSIBLE_REPO_PATH }}/stdout' + dest: '{{ ANSIBLE_REPO_PATH | default('.') }}/stdout' - name: Set inventory ravello groups as fact set_fact: ravello_groups: "{{ task_result.stdout | from_json }}" @@ -139,15 +139,15 @@ var: ravello_groups - name: Configure local ssh config for bastion proxy use - import_playbook: "{{ ANSIBLE_REPO_PATH }}/cloud_providers/{{cloud_provider}}_ssh_config_setup.yml" + import_playbook: "{{ ANSIBLE_REPO_PATH | default('.') }}/cloud_providers/{{cloud_provider}}_ssh_config_setup.yml" - name: Wait for environment Readiness hosts: - bastion - "{{ ('tag_Project_' ~ env_type ~ '_' ~ guid) | replace('-', '_') }}" vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" gather_facts: false any_errors_fatal: True become: true diff --git a/ansible/cloud_providers/archive/ravello_ssh_config_setup.yml b/tools/archive/cloudproviders/archive/ravello_ssh_config_setup.yml similarity index 68% rename from ansible/cloud_providers/archive/ravello_ssh_config_setup.yml rename to tools/archive/cloudproviders/archive/ravello_ssh_config_setup.yml index f788d988476..a5672683df3 100644 --- a/ansible/cloud_providers/archive/ravello_ssh_config_setup.yml +++ b/tools/archive/cloudproviders/archive/ravello_ssh_config_setup.yml @@ -7,8 +7,8 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - step001 - create_ssh_config @@ -25,28 +25,28 @@ copy: content: | #!/bin/bash - ssh -i {{ ANSIBLE_REPO_PATH }}/workdir/{{ guid }}key cloud-user@{{ bastion_hostname.external }} - dest: '{{ ANSIBLE_REPO_PATH }}/workdir/{{ guid }}-quickssh.sh' + ssh -i {{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{ guid }}key cloud-user@{{ bastion_hostname.external }} + dest: '{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{ guid }}-quickssh.sh' mode: 0755 # when: delete_app_post_deploy # - name: set ansible_ssh_common_args # set_fact: # ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -q cloud-user@{{ bastion_hostname.external }}' - # # ansible_ssh_common_args: '-F "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" -o ControlMaster=auto -o ControlPersist=30m' + # # ansible_ssh_common_args: '-F "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" -o ControlMaster=auto -o ControlPersist=30m' - name: Create empty local ssh config as defined by deploy_local_ssh_config_location file: - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" + dest: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" state: touch - name: Add bastion proxy config to workdir ssh config file blockinfile: - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" + dest: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" marker: "##### {mark} ADDED BASTION PROXY HOST {{ env_type }}-{{ guid }} ######" content: | Host {{ bastion_hostname.external }} Hostname {{ bastion_hostname.external }} - IdentityFile {{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }} + IdentityFile {{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{ env_authorized_key }} IdentitiesOnly yes User {{ remote_user }} ControlMaster auto @@ -57,7 +57,7 @@ - bastion_proxy_config_main - name: Add other hosts to workdir ssh file - import_playbook: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/add_hosts_ssh_config.yml" + import_playbook: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/add_hosts_ssh_config.yml" #- name: copy ssh config to /root/.ssh/config # hosts: localhost @@ -71,7 +71,7 @@ # mode: 0400 # - name: copy workdir ssh file to .ssh/config # copy: -# src: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" +# src: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" # dest: /root/.ssh/config # owner: root # group: root diff --git a/ansible/cloud_providers/archive/terraform_ec2_destroy_env.yml b/tools/archive/cloudproviders/archive/terraform_ec2_destroy_env.yml similarity index 73% rename from ansible/cloud_providers/archive/terraform_ec2_destroy_env.yml rename to tools/archive/cloudproviders/archive/terraform_ec2_destroy_env.yml index 50f5d587f77..9ce7e78e0ea 100644 --- a/ansible/cloud_providers/archive/terraform_ec2_destroy_env.yml +++ b/tools/archive/cloudproviders/archive/terraform_ec2_destroy_env.yml @@ -5,12 +5,12 @@ gather_facts: False become: no vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tasks: - name: Terraform | Destroy elements - shell: cd {{ANSIBLE_REPO_PATH}}/workdir ; terraform init ; terraform destroy -force + shell: cd {{ANSIBLE_REPO_PATH | default('.')}}/workdir ; terraform init ; terraform destroy -force tags: - destroying - destroy_terraform_deployment diff --git a/ansible/cloud_providers/archive/terraform_ec2_infrastructure_deployment.yml b/tools/archive/cloudproviders/archive/terraform_ec2_infrastructure_deployment.yml similarity index 80% rename from ansible/cloud_providers/archive/terraform_ec2_infrastructure_deployment.yml rename to tools/archive/cloudproviders/archive/terraform_ec2_infrastructure_deployment.yml index 441baa974c2..fc3c85bd1cf 100644 --- a/ansible/cloud_providers/archive/terraform_ec2_infrastructure_deployment.yml +++ b/tools/archive/cloudproviders/archive/terraform_ec2_infrastructure_deployment.yml @@ -5,8 +5,8 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - step001 - deploy_infrastructure @@ -26,20 +26,20 @@ - name: Terraform | Generate Terraform build file template: - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.{{cloud_provider}}.tf" - src: "{{ANSIBLE_REPO_PATH}}/configs/{{ env_type }}/files/cloud_providers/{{cloud_provider}}_cloud_template.tf.j2" + dest: "{{ANSIBLE_REPO_PATH | default('.')}}/workdir/{{ env_type }}.{{ guid }}.{{cloud_provider}}.tf" + src: "{{ANSIBLE_REPO_PATH | default('.')}}/configs/{{ env_type }}/files/cloud_providers/{{cloud_provider}}_cloud_template.tf.j2" tags: - step001 - name: Terraform | Generate Terraform secrets file template: - dest: "{{ANSIBLE_REPO_PATH}}/workdir/terraform.tfvars" - src: "{{ANSIBLE_REPO_PATH}}/configs/{{ env_type }}/files/cloud_providers/{{cloud_provider}}_cloud_template.tfvars.j2" + dest: "{{ANSIBLE_REPO_PATH | default('.')}}/workdir/terraform.tfvars" + src: "{{ANSIBLE_REPO_PATH | default('.')}}/configs/{{ env_type }}/files/cloud_providers/{{cloud_provider}}_cloud_template.tfvars.j2" tags: - step001 - name: Terraform | Run Terraform - shell: cd {{ANSIBLE_REPO_PATH}}/workdir ; terraform init ; terraform apply chdir="{{ANSIBLE_REPO_PATH}}/workdir" -auto-approve + shell: cd {{ANSIBLE_REPO_PATH | default('.')}}/workdir ; terraform init ; terraform apply chdir="{{ANSIBLE_REPO_PATH | default('.')}}/workdir" -auto-approve tags: - step001 @@ -128,15 +128,15 @@ verbosity: 2 - name: Configure local ssh config for bastion proxy use - import_playbook: "{{ANSIBLE_REPO_PATH}}/cloud_providers/{{cloud_provider}}_ssh_config_setup.yml" + import_playbook: "{{ANSIBLE_REPO_PATH | default('.')}}/cloud_providers/{{cloud_provider}}_ssh_config_setup.yml" when: groups['bastions'] - name: wait_for_connection for all non-windows machines and set hostname hosts: - all:!windows:!network vars_files: - - "{{ANSIBLE_REPO_PATH}}/configs/{{ env_type }}/env_vars.yml" - - "{{ANSIBLE_REPO_PATH}}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ANSIBLE_REPO_PATH | default('.')}}/configs/{{ env_type }}/env_vars.yml" + - "{{ANSIBLE_REPO_PATH | default('.')}}/configs/{{ env_type }}/env_secret_vars.yml" gather_facts: false any_errors_fatal: true ignore_errors: false @@ -172,8 +172,8 @@ hosts: - windows vars_files: - - "{{ANSIBLE_REPO_PATH}}/configs/{{ env_type }}/env_vars.yml" - - "{{ANSIBLE_REPO_PATH}}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ANSIBLE_REPO_PATH | default('.')}}/configs/{{ env_type }}/env_vars.yml" + - "{{ANSIBLE_REPO_PATH | default('.')}}/configs/{{ env_type }}/env_secret_vars.yml" tasks: - name: set facts for remote access set_fact: diff --git a/tools/archive/cloudproviders/archive/terraform_ec2_ssh_config_setup.yml b/tools/archive/cloudproviders/archive/terraform_ec2_ssh_config_setup.yml new file mode 100644 index 00000000000..289ab9da8fe --- /dev/null +++ b/tools/archive/cloudproviders/archive/terraform_ec2_ssh_config_setup.yml @@ -0,0 +1,3 @@ +--- +- name: Configure local ssh config for bastion proxy use + import_playbook: "{{ANSIBLE_REPO_PATH | default('.')}}/cloud_providers/common_ssh_config_setup.yml" diff --git a/ansible/cloud_providers/archive/terraform_infrastructure_deployment.yml b/tools/archive/cloudproviders/archive/terraform_infrastructure_deployment.yml similarity index 76% rename from ansible/cloud_providers/archive/terraform_infrastructure_deployment.yml rename to tools/archive/cloudproviders/archive/terraform_infrastructure_deployment.yml index 66987d10a25..ed976710c51 100644 --- a/ansible/cloud_providers/archive/terraform_infrastructure_deployment.yml +++ b/tools/archive/cloudproviders/archive/terraform_infrastructure_deployment.yml @@ -8,8 +8,8 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - step001 - deploy_infrastructure @@ -30,14 +30,14 @@ - name: Terraform | Template Terraform files locally to run template: dest: "{{ terraform_working_dir }}/{{ workshop_prefix }}/aws.tf" - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/cloud_providers/aws.tf.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/cloud_providers/aws.tf.j2" tags: - step001 - name: Terraform | Template terraform.tfvars template: dest: "{{ terraform_working_dir }}/{{ workshop_prefix }}/terraform.tfvars" - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/cloud_providers/terraform.tfvars.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/cloud_providers/terraform.tfvars.j2" tags: - step001 diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/README.md b/tools/archive/configs/RHCLS-ScalableInfra-demo/README.md similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/README.md rename to tools/archive/configs/RHCLS-ScalableInfra-demo/README.md diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/bastion b/tools/archive/configs/RHCLS-ScalableInfra-demo/bastion similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/bastion rename to tools/archive/configs/RHCLS-ScalableInfra-demo/bastion diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/README b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/README similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/README rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/README diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/ansible/library/ravello_app.py b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/ansible/library/ravello_app.py similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/ansible/library/ravello_app.py rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/ansible/library/ravello_app.py diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/ansible/test.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/ansible/test.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/ansible/test.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/ansible/test.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-create b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-create similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-create rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-create diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-get-all b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-get-all similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-get-all rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-get-all diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-get-billing b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-get-billing similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-get-billing rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-get-billing diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-get-data b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-get-data similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-get-data rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-get-data diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-get-id b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-get-id similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-get-id rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-get-id diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-get-state b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-get-state similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-get-state rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-get-state diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-get-vms b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-get-vms similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-get-vms rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-get-vms diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-start b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-start similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-start rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-start diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-stop b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-stop similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-stop rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-stop diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-update b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-update similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/app-update rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/app-update diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/bp-get-all b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/bp-get-all similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/bp-get-all rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/bp-get-all diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/common.py b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/common.py similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/common.py rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/common.py diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/common.pyc b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/common.pyc similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/common.pyc rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/common.pyc diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/enforce_autostop.py b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/enforce_autostop.py similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/enforce_autostop.py rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/enforce_autostop.py diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/etoken-create b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/etoken-create similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/etoken-create rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/etoken-create diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/ravello.log b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/ravello.log similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/ravello.log rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/ravello.log diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/set-creds b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/set-creds similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/set-creds rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/set-creds diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/startstop.py b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/startstop.py similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/startstop.py rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/startstop.py diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/test.py b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/test.py similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/test.py rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/test.py diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/vm-mgmt b/tools/archive/configs/RHCLS-ScalableInfra-demo/examples/vm-mgmt similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/examples/vm-mgmt rename to tools/archive/configs/RHCLS-ScalableInfra-demo/examples/vm-mgmt diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/exports b/tools/archive/configs/RHCLS-ScalableInfra-demo/exports similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/exports rename to tools/archive/configs/RHCLS-ScalableInfra-demo/exports diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/bastion-play.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/bastion-play.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/bastion-play.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/bastion-play.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/inventory b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/inventory similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/inventory rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/inventory diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/.travis.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/.travis.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/.travis.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/.travis.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/README.md b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/README.md similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/README.md rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/README.md diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/defaults/main.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/defaults/main.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/defaults/main.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/defaults/main.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/handlers/main.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/handlers/main.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/handlers/main.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/handlers/main.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/meta/main.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/meta/main.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/meta/main.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/meta/main.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tasks/iptables.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tasks/iptables.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tasks/iptables.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tasks/iptables.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tasks/main.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tasks/main.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tasks/main.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tasks/main.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tasks/services.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tasks/services.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tasks/services.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tasks/services.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/templates/iptables.j2 b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/templates/iptables.j2 similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/templates/iptables.j2 rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/templates/iptables.j2 diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tests/bastion-play.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tests/bastion-play.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tests/bastion-play.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tests/bastion-play.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tests/inventory b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tests/inventory similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tests/inventory rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tests/inventory diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tests/test.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tests/test.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tests/test.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/tests/test.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/vars/main.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/vars/main.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/vars/main.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/bastion/vars/main.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/.travis.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/.travis.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/.travis.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/.travis.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/README.md b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/README.md similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/README.md rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/README.md diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/defaults/main.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/defaults/main.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/defaults/main.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/defaults/main.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/handlers/main.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/handlers/main.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/handlers/main.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/handlers/main.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/meta/main.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/meta/main.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/meta/main.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/meta/main.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/tasks/main.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/tasks/main.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/tasks/main.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/tasks/main.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/tests/inventory b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/tests/inventory similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/tests/inventory rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/tests/inventory diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/tests/test.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/tests/test.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/tests/test.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/tests/test.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/vars/main.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/vars/main.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/osp/vars/main.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/osp/vars/main.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/.travis.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/.travis.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/.travis.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/.travis.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/README.md b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/README.md similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/README.md rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/README.md diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/defaults/main.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/defaults/main.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/defaults/main.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/defaults/main.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/handlers/main.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/handlers/main.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/handlers/main.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/handlers/main.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/meta/main.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/meta/main.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/meta/main.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/meta/main.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tasks/bastion.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tasks/bastion.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tasks/bastion.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tasks/bastion.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tasks/main.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tasks/main.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tasks/main.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tasks/main.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tasks/osp.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tasks/osp.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tasks/osp.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tasks/osp.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tests/inventory b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tests/inventory similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tests/inventory rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tests/inventory diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tests/test.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tests/test.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tests/test.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/tests/test.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/vars/main.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/vars/main.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/roles/packages/vars/main.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/roles/packages/vars/main.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/variables.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/variables.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/playbooks/variables.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/playbooks/variables.yml diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/redhat.repo b/tools/archive/configs/RHCLS-ScalableInfra-demo/redhat.repo similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/redhat.repo rename to tools/archive/configs/RHCLS-ScalableInfra-demo/redhat.repo diff --git a/ansible/configs/archive/RHCLS-ScalableInfra-demo/software.yml b/tools/archive/configs/RHCLS-ScalableInfra-demo/software.yml similarity index 100% rename from ansible/configs/archive/RHCLS-ScalableInfra-demo/software.yml rename to tools/archive/configs/RHCLS-ScalableInfra-demo/software.yml diff --git a/ansible/configs/archive/ans-network-lab/README.adoc b/tools/archive/configs/ans-network-lab/README.adoc similarity index 95% rename from ansible/configs/archive/ans-network-lab/README.adoc rename to tools/archive/configs/ans-network-lab/README.adoc index f002826c587..4c9b1682bb5 100644 --- a/ansible/configs/archive/ans-network-lab/README.adoc +++ b/tools/archive/configs/ans-network-lab/README.adoc @@ -58,7 +58,7 @@ DEPLOYER_REPO_PATH=`pwd` ansible-playbook \ ${DEPLOYER_REPO_PATH}/main.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" \ -e "env_type=${ENVTYPE}" \ -e "key_name=${KEYNAME}" \ @@ -85,7 +85,7 @@ ENVTYPE="three-tier-app" CLOUDPROVIDER=ec2 #To Destroy an Env ansible-playbook ./configs/${ENVTYPE}/destroy_env.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" -e "env_type=${ENVTYPE}" -e "cloud_provider=${CLOUDPROVIDER}" -e "aws_region=${REGION}" \ -e "HostedZoneId=${HOSTZONEID}" -e "key_name=${KEYNAME}" -e "subdomain_base_suffix=${BASESUFFIX}" diff --git a/ansible/configs/archive/ans-network-lab/destroy_env.yml b/tools/archive/configs/ans-network-lab/destroy_env.yml similarity index 100% rename from ansible/configs/archive/ans-network-lab/destroy_env.yml rename to tools/archive/configs/ans-network-lab/destroy_env.yml diff --git a/ansible/configs/archive/ans-network-lab/env_vars.yml b/tools/archive/configs/ans-network-lab/env_vars.yml similarity index 98% rename from ansible/configs/archive/ans-network-lab/env_vars.yml rename to tools/archive/configs/ans-network-lab/env_vars.yml index 9f15ef590b8..35f26afb562 100644 --- a/ansible/configs/archive/ans-network-lab/env_vars.yml +++ b/tools/archive/configs/ans-network-lab/env_vars.yml @@ -30,7 +30,7 @@ update_packages: false guid: defaultguid # This is where the ssh_config file will be created, this file is used to # define the communication method to all the hosts in the deployment -deploy_local_ssh_config_location: "{{ANSIBLE_REPO_PATH}}/workdir" +deploy_local_ssh_config_location: "{{ANSIBLE_REPO_PATH | default('.')}}/workdir" install_bastion: true install_common: true diff --git a/ansible/configs/archive/ans-network-lab/files/cloud_providers/ec2_cloud_template.j2 b/tools/archive/configs/ans-network-lab/files/cloud_providers/ec2_cloud_template.j2 similarity index 100% rename from ansible/configs/archive/ans-network-lab/files/cloud_providers/ec2_cloud_template.j2 rename to tools/archive/configs/ans-network-lab/files/cloud_providers/ec2_cloud_template.j2 diff --git a/ansible/configs/archive/ans-network-lab/files/cloud_providers/ec2_cloud_template_json.j2 b/tools/archive/configs/ans-network-lab/files/cloud_providers/ec2_cloud_template_json.j2 similarity index 100% rename from ansible/configs/archive/ans-network-lab/files/cloud_providers/ec2_cloud_template_json.j2 rename to tools/archive/configs/ans-network-lab/files/cloud_providers/ec2_cloud_template_json.j2 diff --git a/ansible/configs/archive/ans-network-lab/files/hosts_template.j2 b/tools/archive/configs/ans-network-lab/files/hosts_template.j2 similarity index 100% rename from ansible/configs/archive/ans-network-lab/files/hosts_template.j2 rename to tools/archive/configs/ans-network-lab/files/hosts_template.j2 diff --git a/ansible/configs/archive/ans-network-lab/files/repos_template.j2 b/tools/archive/configs/ans-network-lab/files/repos_template.j2 similarity index 100% rename from ansible/configs/archive/ans-network-lab/files/repos_template.j2 rename to tools/archive/configs/ans-network-lab/files/repos_template.j2 diff --git a/ansible/configs/archive/ans-network-lab/post_infra.yml b/tools/archive/configs/ans-network-lab/post_infra.yml similarity index 100% rename from ansible/configs/archive/ans-network-lab/post_infra.yml rename to tools/archive/configs/ans-network-lab/post_infra.yml diff --git a/ansible/configs/archive/ans-network-lab/post_software.yml b/tools/archive/configs/ans-network-lab/post_software.yml similarity index 67% rename from ansible/configs/archive/ans-network-lab/post_software.yml rename to tools/archive/configs/ans-network-lab/post_software.yml index 4308ed816ad..f0474b1e895 100644 --- a/ansible/configs/archive/ans-network-lab/post_software.yml +++ b/tools/archive/configs/ans-network-lab/post_software.yml @@ -3,7 +3,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - debug: msg: "Post-Software tasks Started" @@ -15,7 +15,7 @@ tags: - opentlc_bastion_tasks vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: # sssd bug, fixed by restart - name: restart sssd @@ -30,8 +30,8 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - post_flight_check tasks: diff --git a/ansible/configs/archive/ans-network-lab/pre_infra.yml b/tools/archive/configs/ans-network-lab/pre_infra.yml similarity index 100% rename from ansible/configs/archive/ans-network-lab/pre_infra.yml rename to tools/archive/configs/ans-network-lab/pre_infra.yml diff --git a/tools/archive/configs/ans-network-lab/pre_software.yml b/tools/archive/configs/ans-network-lab/pre_software.yml new file mode 100644 index 00000000000..e62b0493c76 --- /dev/null +++ b/tools/archive/configs/ans-network-lab/pre_software.yml @@ -0,0 +1,63 @@ + +- name: Step 003 - Create env key + hosts: localhost + connection: local + gather_facts: false + become: false + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + tags: + - step003 + - generate_env_keys + tasks: + - name: Generate SSH keys + shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" -q -N "" + args: + creates: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" + when: set_env_authorized_key + +# Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} + +- name: Configure all hosts with Repositories, Common Files and Set environment key + hosts: + - all:!windows!network + become: true + gather_facts: False + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + tags: + - step004 + - common_tasks + roles: + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } + +- name: Configuring Bastion Hosts + hosts: bastions + become: true + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + roles: + - { role: "bastion", when: 'install_bastion' } + - { role: "bastion-opentlc-ipa", when: 'install_ipa_client' } + tags: + - step004 + - bastion_tasks + +- name: PreSoftware flight-check + hosts: localhost + connection: local + gather_facts: false + become: false + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + tags: + - flight_check + tasks: + - debug: + msg: "Pre-Software checks completed successfully" diff --git a/ansible/configs/archive/ans-network-lab/software.yml b/tools/archive/configs/ans-network-lab/software.yml similarity index 100% rename from ansible/configs/archive/ans-network-lab/software.yml rename to tools/archive/configs/ans-network-lab/software.yml diff --git a/ansible/configs/archive/ansible-tower-terraform/How.To.Create.Env.Type.adoc b/tools/archive/configs/ansible-tower-terraform/How.To.Create.Env.Type.adoc similarity index 100% rename from ansible/configs/archive/ansible-tower-terraform/How.To.Create.Env.Type.adoc rename to tools/archive/configs/ansible-tower-terraform/How.To.Create.Env.Type.adoc diff --git a/ansible/configs/archive/ansible-tower-terraform/README.adoc b/tools/archive/configs/ansible-tower-terraform/README.adoc similarity index 93% rename from ansible/configs/archive/ansible-tower-terraform/README.adoc rename to tools/archive/configs/ansible-tower-terraform/README.adoc index 9dee66529b7..ee84adadaba 100644 --- a/ansible/configs/archive/ansible-tower-terraform/README.adoc +++ b/tools/archive/configs/ansible-tower-terraform/README.adoc @@ -55,7 +55,7 @@ zone_id: "" ansible-playbook -i ansible/inventory/ec2.py \ -e "env_type=ansible-tower-terraform" \ -e "workshop_prefix=testing123" \ - -e "ANSIBLE_REPO_PATH='{{ lookup('env','PWD') }}/ansible'" \ + -e "ANSIBLE_REPO_PATH | default('.')='{{ lookup('env','PWD') }}/ansible'" \ -e "cloud_provider=terraform" \ -e "software_to_deploy=none" \ ansible/main.yml @@ -67,7 +67,7 @@ ansible-playbook -i ansible/inventory/ec2.py \ ansible-playbook -i ansible/inventory/ec2.py \ -e "env_type=ansible-tower-terraform" \ -e "workshop_prefix=testing123" \ - -e "ANSIBLE_REPO_PATH='{{ lookup('env','PWD') }}/ansible'" \ + -e "ANSIBLE_REPO_PATH | default('.')='{{ lookup('env','PWD') }}/ansible'" \ -e "cloud_provider=terraform" \ -e "software_to_deploy=none" \ ansible/destroy.yml diff --git a/ansible/configs/archive/ansible-tower-terraform/destroy_env.yml b/tools/archive/configs/ansible-tower-terraform/destroy_env.yml similarity index 68% rename from ansible/configs/archive/ansible-tower-terraform/destroy_env.yml rename to tools/archive/configs/ansible-tower-terraform/destroy_env.yml index 0ab7cbf188f..8bf3d07c917 100644 --- a/ansible/configs/archive/ansible-tower-terraform/destroy_env.yml +++ b/tools/archive/configs/ansible-tower-terraform/destroy_env.yml @@ -18,10 +18,10 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/unregister" } + - { role: "unregister" } - name: Terraform | Terraform Destroy hosts: localhost @@ -29,8 +29,8 @@ gather_facts: False become: no vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tasks: - name: Terraform | Terraform Destroy Command expect: diff --git a/ansible/configs/archive/ansible-tower-terraform/env_vars.yml b/tools/archive/configs/ansible-tower-terraform/env_vars.yml similarity index 100% rename from ansible/configs/archive/ansible-tower-terraform/env_vars.yml rename to tools/archive/configs/ansible-tower-terraform/env_vars.yml diff --git a/ansible/configs/archive/ansible-tower-terraform/files/cloud_providers/aws.tf.j2 b/tools/archive/configs/ansible-tower-terraform/files/cloud_providers/aws.tf.j2 similarity index 100% rename from ansible/configs/archive/ansible-tower-terraform/files/cloud_providers/aws.tf.j2 rename to tools/archive/configs/ansible-tower-terraform/files/cloud_providers/aws.tf.j2 diff --git a/ansible/configs/archive/ansible-tower-terraform/files/cloud_providers/terraform.tfvars.j2 b/tools/archive/configs/ansible-tower-terraform/files/cloud_providers/terraform.tfvars.j2 similarity index 100% rename from ansible/configs/archive/ansible-tower-terraform/files/cloud_providers/terraform.tfvars.j2 rename to tools/archive/configs/ansible-tower-terraform/files/cloud_providers/terraform.tfvars.j2 diff --git a/ansible/configs/archive/ansible-tower-terraform/post_infra.yml b/tools/archive/configs/ansible-tower-terraform/post_infra.yml similarity index 74% rename from ansible/configs/archive/ansible-tower-terraform/post_infra.yml rename to tools/archive/configs/ansible-tower-terraform/post_infra.yml index 557764db459..1bb0618feb5 100644 --- a/ansible/configs/archive/ansible-tower-terraform/post_infra.yml +++ b/tools/archive/configs/ansible-tower-terraform/post_infra.yml @@ -19,8 +19,8 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tasks: - name: Ping ping: diff --git a/ansible/configs/archive/ansible-tower-terraform/post_software.yml b/tools/archive/configs/ansible-tower-terraform/post_software.yml similarity index 74% rename from ansible/configs/archive/ansible-tower-terraform/post_software.yml rename to tools/archive/configs/ansible-tower-terraform/post_software.yml index f6e95115221..9148a367be1 100644 --- a/ansible/configs/archive/ansible-tower-terraform/post_software.yml +++ b/tools/archive/configs/ansible-tower-terraform/post_software.yml @@ -20,8 +20,8 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tasks: - name: Ping ping: diff --git a/ansible/configs/archive/ansible-tower-terraform/pre_infra.yml b/tools/archive/configs/ansible-tower-terraform/pre_infra.yml similarity index 100% rename from ansible/configs/archive/ansible-tower-terraform/pre_infra.yml rename to tools/archive/configs/ansible-tower-terraform/pre_infra.yml diff --git a/tools/archive/configs/ansible-tower-terraform/pre_software.yml b/tools/archive/configs/ansible-tower-terraform/pre_software.yml new file mode 100644 index 00000000000..1167155196a --- /dev/null +++ b/tools/archive/configs/ansible-tower-terraform/pre_software.yml @@ -0,0 +1,33 @@ +# file: pre_software.yml +- name: Pre-Software | Step 000 Pre Software + hosts: localhost + connection: local + become: False + vars_files: + - "./env_vars.yml" + - "./env_secret_vars.yml" + tags: + - step003 + - pre_software + tasks: + - debug: + msg: "{{ 'tag_Workshop_' + workshop_prefix }}" + + +- name: Pre-Software | Setup Ansible Tower Workshop + hosts: "{{ 'tag_Workshop_' + workshop_prefix }}" + gather_facts: True + become: yes + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + roles: + - { role: "subscription_manager" } + - { role: "epel" } + - { role: "nodejs" } + - { role: "wetty" } + - { role: "ansible.tower" } + - { role: "zsh" } + # - { role: "cockpit" } + + diff --git a/ansible/configs/archive/ansible-tower-terraform/software.yml b/tools/archive/configs/ansible-tower-terraform/software.yml similarity index 100% rename from ansible/configs/archive/ansible-tower-terraform/software.yml rename to tools/archive/configs/ansible-tower-terraform/software.yml diff --git a/ansible/configs/archive/auth-playground-lab/README.adoc b/tools/archive/configs/auth-playground-lab/README.adoc similarity index 97% rename from ansible/configs/archive/auth-playground-lab/README.adoc rename to tools/archive/configs/auth-playground-lab/README.adoc index 0ad632c9ae3..0165455db4f 100644 --- a/ansible/configs/archive/auth-playground-lab/README.adoc +++ b/tools/archive/configs/auth-playground-lab/README.adoc @@ -58,7 +58,7 @@ DEPLOYER_REPO_PATH=`pwd` ansible-playbook \ ${DEPLOYER_REPO_PATH}/main.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" \ -e "env_type=${ENVTYPE}" \ -e "key_name=${KEYNAME}" \ diff --git a/ansible/configs/archive/auth-playground-lab/destroy_env.yml b/tools/archive/configs/auth-playground-lab/destroy_env.yml similarity index 100% rename from ansible/configs/archive/auth-playground-lab/destroy_env.yml rename to tools/archive/configs/auth-playground-lab/destroy_env.yml diff --git a/ansible/configs/archive/auth-playground-lab/env_vars.yml b/tools/archive/configs/auth-playground-lab/env_vars.yml similarity index 98% rename from ansible/configs/archive/auth-playground-lab/env_vars.yml rename to tools/archive/configs/auth-playground-lab/env_vars.yml index 12d27a0962e..7fa65d14fce 100644 --- a/ansible/configs/archive/auth-playground-lab/env_vars.yml +++ b/tools/archive/configs/auth-playground-lab/env_vars.yml @@ -37,7 +37,7 @@ update_packages: false guid: defaultguid # This is where the ssh_config file will be created, this file is used to # define the communication method to all the hosts in the deployment -deploy_local_ssh_config_location: "{{ANSIBLE_REPO_PATH}}/workdir" +deploy_local_ssh_config_location: "{{ANSIBLE_REPO_PATH | default('.')}}/workdir" install_bastion: true install_common: true diff --git a/ansible/configs/archive/auth-playground-lab/files/cloud_providers/ec2_cloud_template.j2 b/tools/archive/configs/auth-playground-lab/files/cloud_providers/ec2_cloud_template.j2 similarity index 100% rename from ansible/configs/archive/auth-playground-lab/files/cloud_providers/ec2_cloud_template.j2 rename to tools/archive/configs/auth-playground-lab/files/cloud_providers/ec2_cloud_template.j2 diff --git a/ansible/configs/archive/auth-playground-lab/files/hosts_template.j2 b/tools/archive/configs/auth-playground-lab/files/hosts_template.j2 similarity index 100% rename from ansible/configs/archive/auth-playground-lab/files/hosts_template.j2 rename to tools/archive/configs/auth-playground-lab/files/hosts_template.j2 diff --git a/ansible/configs/archive/auth-playground-lab/files/opentlc-sample-config.sh.j2 b/tools/archive/configs/auth-playground-lab/files/opentlc-sample-config.sh.j2 similarity index 100% rename from ansible/configs/archive/auth-playground-lab/files/opentlc-sample-config.sh.j2 rename to tools/archive/configs/auth-playground-lab/files/opentlc-sample-config.sh.j2 diff --git a/ansible/configs/archive/auth-playground-lab/files/repos_template.j2 b/tools/archive/configs/auth-playground-lab/files/repos_template.j2 similarity index 100% rename from ansible/configs/archive/auth-playground-lab/files/repos_template.j2 rename to tools/archive/configs/auth-playground-lab/files/repos_template.j2 diff --git a/ansible/configs/archive/auth-playground-lab/post_infra.yml b/tools/archive/configs/auth-playground-lab/post_infra.yml similarity index 100% rename from ansible/configs/archive/auth-playground-lab/post_infra.yml rename to tools/archive/configs/auth-playground-lab/post_infra.yml diff --git a/ansible/configs/archive/auth-playground-lab/post_software.yml b/tools/archive/configs/auth-playground-lab/post_software.yml similarity index 59% rename from ansible/configs/archive/auth-playground-lab/post_software.yml rename to tools/archive/configs/auth-playground-lab/post_software.yml index b6441daa754..74a8011083c 100644 --- a/ansible/configs/archive/auth-playground-lab/post_software.yml +++ b/tools/archive/configs/auth-playground-lab/post_software.yml @@ -3,7 +3,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - debug: msg: "Post-Software tasks Started" @@ -14,11 +14,11 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" run_once: true roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/ipa-server", configure_firewalld: "false", when: install_ipa + - { role: "ipa-server", configure_firewalld: "false", when: install_ipa } tags: - ipa_server_tasks @@ -29,11 +29,11 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: generate ipa sample user script template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/opentlc-sample-config.sh.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/opentlc-sample-config.sh.j2" dest: "/root/opentlc-sample-config.sh" when: install_ipa | bool - name: run user creation script @@ -46,14 +46,14 @@ - windows[0] gather_facts: False vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - step004 - common_tasks - windows_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/windows-ad", when: install_win_ad | bool } + - { role: "windows-ad", when: install_win_ad | bool } tasks: - name: Reboot upon promotion win_reboot: @@ -69,8 +69,8 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - post_flight_check tasks: diff --git a/ansible/configs/archive/auth-playground-lab/pre_infra.yml b/tools/archive/configs/auth-playground-lab/pre_infra.yml similarity index 82% rename from ansible/configs/archive/auth-playground-lab/pre_infra.yml rename to tools/archive/configs/auth-playground-lab/pre_infra.yml index 1c729639fdd..159dacb0d18 100644 --- a/ansible/configs/archive/auth-playground-lab/pre_infra.yml +++ b/tools/archive/configs/auth-playground-lab/pre_infra.yml @@ -14,7 +14,7 @@ block: - name: Stat workdir/[...]_windows_password.txt file stat: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{guid}}_windows_password.txt" + path: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{ env_type }}_{{guid}}_windows_password.txt" register: passwordfile # This task needs to be "ansibled", we cannot assume tr exists # This also doesn't work on MAC, that does have tr. @@ -24,7 +24,7 @@ when: not passwordfile.stat.exists - name: Read windows password from workdir/[...]_windows_password.txt file - command: "cat '{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{guid}}_windows_password.txt'" + command: "cat '{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{ env_type }}_{{guid}}_windows_password.txt'" register: password_get_r changed_when: false when: passwordfile.stat.exists @@ -43,5 +43,5 @@ - name: Save windows_password or generated_windows_password into workdir/ copy: content: "{{ windows_password | default(generated_windows_password) }}" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{guid}}_windows_password.txt" + dest: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{ env_type }}_{{guid}}_windows_password.txt" mode: 0600 diff --git a/tools/archive/configs/auth-playground-lab/pre_software.yml b/tools/archive/configs/auth-playground-lab/pre_software.yml new file mode 100644 index 00000000000..2d9e7371a96 --- /dev/null +++ b/tools/archive/configs/auth-playground-lab/pre_software.yml @@ -0,0 +1,79 @@ +--- +- name: Step 003 - Create env key + hosts: localhost + connection: local + gather_facts: false + become: false + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + tags: + - step003 + - generate_env_keys + tasks: + - name: Generate SSH keys + shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" -q -N "" + args: + creates: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" + when: set_env_authorized_key + +# Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} + +- name: Configure all hosts with Repositories, Common Files and Set environment key + hosts: + - all:!windows + become: true + gather_facts: False + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + tags: + - step004 + - common_tasks + roles: + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } + +- name: Configuring Bastion Hosts + hosts: bastions + become: true + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + roles: + - { role: "bastion", when: 'install_bastion' } + - { role: "bastion-opentlc-ipa", when: 'install_ipa_client' } + tags: + - step004 + - bastion_tasks + +- name: Configure windows machines + hosts: + - activedirectories + gather_facts: False + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + tags: + - step004 + - common_tasks + - windows_tasks + roles: + - role: "windows-common" + when: install_win_ssh + + +- name: PreSoftware flight-check + hosts: localhost + connection: local + gather_facts: false + become: false + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + tags: + - flight_check + tasks: + - debug: + msg: "Pre-Software checks completed successfully" diff --git a/ansible/configs/archive/auth-playground-lab/software.yml b/tools/archive/configs/auth-playground-lab/software.yml similarity index 100% rename from ansible/configs/archive/auth-playground-lab/software.yml rename to tools/archive/configs/auth-playground-lab/software.yml diff --git a/ansible/configs/archive/generic-example/README.adoc b/tools/archive/configs/generic-example/README.adoc similarity index 97% rename from ansible/configs/archive/generic-example/README.adoc rename to tools/archive/configs/generic-example/README.adoc index 55899d88173..381a5014565 100644 --- a/ansible/configs/archive/generic-example/README.adoc +++ b/tools/archive/configs/generic-example/README.adoc @@ -57,7 +57,7 @@ DEPLOYER_REPO_PATH=`pwd` ansible-playbook \ ${DEPLOYER_REPO_PATH}/main.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "guid=${GUID}" \ -e "env_type=${ENVTYPE}" \ -e "key_name=${KEYNAME}" \ diff --git a/tools/archive/configs/generic-example/destroy_env.yml b/tools/archive/configs/generic-example/destroy_env.yml new file mode 100644 index 00000000000..ef29a457e0a --- /dev/null +++ b/tools/archive/configs/generic-example/destroy_env.yml @@ -0,0 +1,3 @@ +--- +- name: Import default CloudFormation (aws) destroy playbook + import_playbook: "{{ANSIBLE_REPO_PATH | default('.')}}/cloud_providers/{{cloud_provider}}_destroy_env.yml" diff --git a/ansible/configs/archive/generic-example/env_vars.yml b/tools/archive/configs/generic-example/env_vars.yml similarity index 98% rename from ansible/configs/archive/generic-example/env_vars.yml rename to tools/archive/configs/generic-example/env_vars.yml index 2a3799facb3..f17e82099a9 100644 --- a/ansible/configs/archive/generic-example/env_vars.yml +++ b/tools/archive/configs/generic-example/env_vars.yml @@ -31,7 +31,7 @@ update_packages: false guid: defaultguid # This is where the ssh_config file will be created, this file is used to # define the communication method to all the hosts in the deployment -deploy_local_ssh_config_location: "{{ANSIBLE_REPO_PATH}}/workdir" +deploy_local_ssh_config_location: "{{ANSIBLE_REPO_PATH | default('.')}}/workdir" install_bastion: true install_common: true diff --git a/ansible/configs/archive/generic-example/files/cloud_providers/ec2_cloud_template.j2 b/tools/archive/configs/generic-example/files/cloud_providers/ec2_cloud_template.j2 similarity index 100% rename from ansible/configs/archive/generic-example/files/cloud_providers/ec2_cloud_template.j2 rename to tools/archive/configs/generic-example/files/cloud_providers/ec2_cloud_template.j2 diff --git a/ansible/configs/archive/generic-example/files/hosts_template.j2 b/tools/archive/configs/generic-example/files/hosts_template.j2 similarity index 100% rename from ansible/configs/archive/generic-example/files/hosts_template.j2 rename to tools/archive/configs/generic-example/files/hosts_template.j2 diff --git a/ansible/configs/archive/generic-example/files/repos_template.j2 b/tools/archive/configs/generic-example/files/repos_template.j2 similarity index 100% rename from ansible/configs/archive/generic-example/files/repos_template.j2 rename to tools/archive/configs/generic-example/files/repos_template.j2 diff --git a/ansible/configs/archive/generic-example/post_infra.yml b/tools/archive/configs/generic-example/post_infra.yml similarity index 81% rename from ansible/configs/archive/generic-example/post_infra.yml rename to tools/archive/configs/generic-example/post_infra.yml index 6d1a9437cd6..d6cad7451f0 100644 --- a/ansible/configs/archive/generic-example/post_infra.yml +++ b/tools/archive/configs/generic-example/post_infra.yml @@ -3,8 +3,8 @@ connection: local become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - step002 - post_infrastructure diff --git a/ansible/configs/archive/generic-example/post_software.yml b/tools/archive/configs/generic-example/post_software.yml similarity index 60% rename from ansible/configs/archive/generic-example/post_software.yml rename to tools/archive/configs/generic-example/post_software.yml index 04bbd296be6..6ec556a850b 100644 --- a/ansible/configs/archive/generic-example/post_software.yml +++ b/tools/archive/configs/generic-example/post_software.yml @@ -4,8 +4,8 @@ gather_facts: False become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tasks: - debug: msg: "Post-Software tasks Started" @@ -16,11 +16,11 @@ gather_facts: False run_once: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tasks: - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool - name: PostSoftware flight-check diff --git a/ansible/configs/archive/generic-example/pre_infra.yml b/tools/archive/configs/generic-example/pre_infra.yml similarity index 57% rename from ansible/configs/archive/generic-example/pre_infra.yml rename to tools/archive/configs/generic-example/pre_infra.yml index d19583c647d..9ada04ee60f 100644 --- a/ansible/configs/archive/generic-example/pre_infra.yml +++ b/tools/archive/configs/generic-example/pre_infra.yml @@ -4,8 +4,8 @@ connection: local become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - step001 - pre_infrastructure diff --git a/tools/archive/configs/generic-example/pre_software.yml b/tools/archive/configs/generic-example/pre_software.yml new file mode 100644 index 00000000000..5d0d48fa10e --- /dev/null +++ b/tools/archive/configs/generic-example/pre_software.yml @@ -0,0 +1,63 @@ +--- +- name: Step 003 - Create env key + hosts: localhost + connection: local + gather_facts: false + become: false + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + tags: + - step003 + - generate_env_keys + tasks: + - name: Generate SSH keys + shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" -q -N "" + args: + creates: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" + when: set_env_authorized_key + +# Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} + +- name: Configure all hosts with Repositories, Common Files and Set environment key + hosts: + - all:!windows + become: true + gather_facts: False + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + tags: + - step004 + - common_tasks + roles: + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } + +- name: Configuring Bastion Hosts + hosts: bastions + become: true + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + roles: + - role: "bastion" + when: install_bastion|bool + tags: + - step004 + - bastion_tasks + +- name: PreSoftware flight-check + hosts: localhost + connection: local + gather_facts: false + become: false + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + tags: + - flight_check + tasks: + - debug: + msg: "Pre-Software checks completed successfully" diff --git a/ansible/configs/archive/generic-example/software.yml b/tools/archive/configs/generic-example/software.yml similarity index 100% rename from ansible/configs/archive/generic-example/software.yml rename to tools/archive/configs/generic-example/software.yml diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/README.adoc b/tools/archive/configs/ocp-adv-deploy-hw/README.adoc similarity index 96% rename from ansible/configs/archive/ocp-adv-deploy-hw/README.adoc rename to tools/archive/configs/ocp-adv-deploy-hw/README.adoc index 90a92a6b7e1..8f775f7fdb9 100644 --- a/ansible/configs/archive/ocp-adv-deploy-hw/README.adoc +++ b/tools/archive/configs/ocp-adv-deploy-hw/README.adoc @@ -99,7 +99,7 @@ LOG_FILE=$(pwd)/${ENVTYPE}-${GUID}.log -e "email=name@example.com" \ -e "repo_method=file" -e "own_repo_path=${REPO_PATH}" -e "repo_version=${REPO_VERSION}" \ -e "software_to_deploy=openshift" -e "osrelease=3.6.173.0.21" -e "docker_version=1.12.6" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ --skip-tags=installing_openshift,get_openshift_credentials 1>> $LOG_FILE 2>> $LOG_FILE . To Delete an environment @@ -109,7 +109,7 @@ ansible-playbook \ ${DEPLOYER_REPO_PATH}/configs/${ENVTYPE}/destroy_env.yml \ -e "guid=${GUID}" -e "env_type=${ENVTYPE}" \ -e "cloud_provider=${CLOUDPROVIDER}" -e "aws_region=${REGION}" -e "HostedZoneId=${HOSTZONEID}" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "key_name=${KEYNAME}" -e "subdomain_base_suffix=${BASESUFFIX}" ---- diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/destroy_env.yml b/tools/archive/configs/ocp-adv-deploy-hw/destroy_env.yml similarity index 100% rename from ansible/configs/archive/ocp-adv-deploy-hw/destroy_env.yml rename to tools/archive/configs/ocp-adv-deploy-hw/destroy_env.yml diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/env_vars.yml b/tools/archive/configs/ocp-adv-deploy-hw/env_vars.yml similarity index 100% rename from ansible/configs/archive/ocp-adv-deploy-hw/env_vars.yml rename to tools/archive/configs/ocp-adv-deploy-hw/env_vars.yml diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/files/cloud_providers/ec2_cloud_template.j2 b/tools/archive/configs/ocp-adv-deploy-hw/files/cloud_providers/ec2_cloud_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-adv-deploy-hw/files/cloud_providers/ec2_cloud_template.j2 rename to tools/archive/configs/ocp-adv-deploy-hw/files/cloud_providers/ec2_cloud_template.j2 diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/files/ec2_internal_dns.json.j2 b/tools/archive/configs/ocp-adv-deploy-hw/files/ec2_internal_dns.json.j2 similarity index 100% rename from ansible/configs/archive/ocp-adv-deploy-hw/files/ec2_internal_dns.json.j2 rename to tools/archive/configs/ocp-adv-deploy-hw/files/ec2_internal_dns.json.j2 diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/files/hosts_template.3.9.14.j2 b/tools/archive/configs/ocp-adv-deploy-hw/files/hosts_template.3.9.14.j2 similarity index 100% rename from ansible/configs/archive/ocp-adv-deploy-hw/files/hosts_template.3.9.14.j2 rename to tools/archive/configs/ocp-adv-deploy-hw/files/hosts_template.3.9.14.j2 diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/files/hosts_template.3.9.25.j2 b/tools/archive/configs/ocp-adv-deploy-hw/files/hosts_template.3.9.25.j2 similarity index 100% rename from ansible/configs/archive/ocp-adv-deploy-hw/files/hosts_template.3.9.25.j2 rename to tools/archive/configs/ocp-adv-deploy-hw/files/hosts_template.3.9.25.j2 diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/files/hosts_template.3.9.27.j2 b/tools/archive/configs/ocp-adv-deploy-hw/files/hosts_template.3.9.27.j2 similarity index 100% rename from ansible/configs/archive/ocp-adv-deploy-hw/files/hosts_template.3.9.27.j2 rename to tools/archive/configs/ocp-adv-deploy-hw/files/hosts_template.3.9.27.j2 diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/files/htpasswd.openshift b/tools/archive/configs/ocp-adv-deploy-hw/files/htpasswd.openshift similarity index 100% rename from ansible/configs/archive/ocp-adv-deploy-hw/files/htpasswd.openshift rename to tools/archive/configs/ocp-adv-deploy-hw/files/htpasswd.openshift diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/files/labs_hosts_template.j2 b/tools/archive/configs/ocp-adv-deploy-hw/files/labs_hosts_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-adv-deploy-hw/files/labs_hosts_template.j2 rename to tools/archive/configs/ocp-adv-deploy-hw/files/labs_hosts_template.j2 diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/files/pvs.j2 b/tools/archive/configs/ocp-adv-deploy-hw/files/pvs.j2 similarity index 100% rename from ansible/configs/archive/ocp-adv-deploy-hw/files/pvs.j2 rename to tools/archive/configs/ocp-adv-deploy-hw/files/pvs.j2 diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/files/repos_template.j2 b/tools/archive/configs/ocp-adv-deploy-hw/files/repos_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-adv-deploy-hw/files/repos_template.j2 rename to tools/archive/configs/ocp-adv-deploy-hw/files/repos_template.j2 diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/files/userpvs.j2 b/tools/archive/configs/ocp-adv-deploy-hw/files/userpvs.j2 similarity index 100% rename from ansible/configs/archive/ocp-adv-deploy-hw/files/userpvs.j2 rename to tools/archive/configs/ocp-adv-deploy-hw/files/userpvs.j2 diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/post_infra.yml b/tools/archive/configs/ocp-adv-deploy-hw/post_infra.yml similarity index 100% rename from ansible/configs/archive/ocp-adv-deploy-hw/post_infra.yml rename to tools/archive/configs/ocp-adv-deploy-hw/post_infra.yml diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/post_ocp_nfs_config.yml b/tools/archive/configs/ocp-adv-deploy-hw/post_ocp_nfs_config.yml similarity index 80% rename from ansible/configs/archive/ocp-adv-deploy-hw/post_ocp_nfs_config.yml rename to tools/archive/configs/ocp-adv-deploy-hw/post_ocp_nfs_config.yml index 2829ecf4a58..34fd42e9403 100644 --- a/ansible/configs/archive/ocp-adv-deploy-hw/post_ocp_nfs_config.yml +++ b/tools/archive/configs/ocp-adv-deploy-hw/post_ocp_nfs_config.yml @@ -3,7 +3,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: Create user vols shell: "mkdir -p /srv/nfs/user-vols/vol{1..{{user_vols}}}" @@ -15,7 +15,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: get nfs Hostname set_fact: @@ -28,7 +28,7 @@ - name: Generate PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/pvs.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/pvs.j2" dest: "/root/pvs-{{ env_type }}-{{ guid }}.yml" tags: [ gen_pv_file ] when: pv_list.0 is defined @@ -42,7 +42,7 @@ - name: Generate user vol PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/userpvs.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/userpvs.j2" dest: "/root/userpvs-{{ env_type }}-{{ guid }}.yml" tags: - gen_user_vol_pv diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/post_software.yml b/tools/archive/configs/ocp-adv-deploy-hw/post_software.yml similarity index 76% rename from ansible/configs/archive/ocp-adv-deploy-hw/post_software.yml rename to tools/archive/configs/ocp-adv-deploy-hw/post_software.yml index f4dca84aaca..ace53eb1f33 100644 --- a/ansible/configs/archive/ocp-adv-deploy-hw/post_software.yml +++ b/tools/archive/configs/ocp-adv-deploy-hw/post_software.yml @@ -12,15 +12,15 @@ tasks: - name: Generate /etc/ansible/hosts file with lab hosts template template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/labs_hosts_template.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/labs_hosts_template.j2" + dest: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" - name: Configure NFS host for user-vols if required hosts: support gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: Create user vols shell: "mkdir -p /srv/nfs/user-vols/vol{1..{{user_vols}}}" @@ -38,7 +38,7 @@ tags: - opentlc_bastion_tasks vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: Move complete inventory file to preserve directory. shell: mv /etc/ansible/hosts /var/preserve/ @@ -47,7 +47,7 @@ - name: Copy over ansible hosts file, lab version copy: backup: no - src: "{{ ANSIBLE_REPO_PATH }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" dest: /etc/ansible/hosts tags: - overwrite_hosts_with_lab_hosts @@ -66,7 +66,7 @@ - openshift_nfs_config - name: Generate PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/pvs.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/pvs.j2" dest: "/root/pvs-{{ env_type }}-{{ guid }}.yml" tags: [ gen_pv_file ] when: pv_list.0 is defined @@ -82,7 +82,7 @@ - name: Generate user vol PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/userpvs.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/userpvs.j2" dest: "/root/userpvs-{{ env_type }}-{{ guid }}.yml" tags: - gen_user_vol_pv @@ -101,7 +101,7 @@ - openshift_nfs_config - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool - name: PostSoftware flight-check @@ -110,8 +110,8 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - post_flight_check tasks: diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/pre_infra.yml b/tools/archive/configs/ocp-adv-deploy-hw/pre_infra.yml similarity index 100% rename from ansible/configs/archive/ocp-adv-deploy-hw/pre_infra.yml rename to tools/archive/configs/ocp-adv-deploy-hw/pre_infra.yml diff --git a/tools/archive/configs/ocp-adv-deploy-hw/pre_software.yml b/tools/archive/configs/ocp-adv-deploy-hw/pre_software.yml new file mode 100644 index 00000000000..3cd13ba6a95 --- /dev/null +++ b/tools/archive/configs/ocp-adv-deploy-hw/pre_software.yml @@ -0,0 +1,74 @@ + +- name: Step 003 - Create env key + hosts: localhost + connection: local + gather_facts: false + become: false + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + tags: + - step003 + - generate_env_keys + tasks: + - name: Generate SSH keys + shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" -q -N "" + args: + creates: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" + when: set_env_authorized_key + + - name: fix permission + file: + path: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" + mode: 0400 + when: set_env_authorized_key + + - name: Generate SSH pub key + shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}.pub" + args: + creates: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}.pub" + when: set_env_authorized_key + +# Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} + +- name: Configure all hosts with Repositories, Common Files and Set environment key + hosts: all + become: true + gather_facts: False + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + tags: + - step004 + - common_tasks + roles: + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } + +- name: Configuring Bastion Hosts + hosts: bastions + become: true + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + roles: + - { role: "bastion", when: 'install_bastion' } + tags: + - step004 + - bastion_tasks + + +- name: PreSoftware flight-check + hosts: localhost + connection: local + gather_facts: false + become: false + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + tags: + - flight_check + tasks: + - debug: + msg: "Pre-Software checks completed successfully" diff --git a/ansible/configs/archive/ocp-adv-deploy-hw/software.yml b/tools/archive/configs/ocp-adv-deploy-hw/software.yml similarity index 100% rename from ansible/configs/archive/ocp-adv-deploy-hw/software.yml rename to tools/archive/configs/ocp-adv-deploy-hw/software.yml diff --git a/ansible/configs/archive/ocp-demo-lab/README.adoc b/tools/archive/configs/ocp-demo-lab/README.adoc similarity index 94% rename from ansible/configs/archive/ocp-demo-lab/README.adoc rename to tools/archive/configs/ocp-demo-lab/README.adoc index 264d48033f1..8628d8bac06 100644 --- a/ansible/configs/archive/ocp-demo-lab/README.adoc +++ b/tools/archive/configs/ocp-demo-lab/README.adoc @@ -61,17 +61,17 @@ BASESUFFIX='.example.opentlc.com' IPAPASS=aaaaaa REPO_VERSION=3.6 NODE_COUNT=2 -ANSIBLE_REPO_PATH=`pwd` +ANSIBLE_REPO_PATH | default('.')=`pwd` time ansible-playbook ./main.yml \ -e "osrelease=3.6.173.0.21" -e "repo_version=${REPO_VERSION}" -e "docker_version=1.12.6" \ -e "guid=${GUID}" -e "env_type=${ENVTYPE}" -e "cloud_provider=${CLOUDPROVIDER}" \ -e "aws_region=${REGION}" -e "HostedZoneId=${HOSTZONEID}" -e "key_name=${KEYNAME}" \ -e "subdomain_base_suffix=${BASESUFFIX}" -e "install_idm=htpasswd" \ - -e "email=name@example.com" -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "email=name@example.com" -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "node_instance_count=${NODE_COUNT}" -e "infranode_instance_count=1" -e "master_instance_count=1" \ -e "software_to_deploy=openshift" -e "own_repo_path=${REPO_PATH}" -e "ipa_host_password=${IPAPASS}" \ - -e "tower_run=false" -e"install_ipa_client=false" -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" + -e "tower_run=false" -e"install_ipa_client=false" -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" . To Delete an environment ---- diff --git a/ansible/configs/archive/ocp-demo-lab/destroy_env.yml b/tools/archive/configs/ocp-demo-lab/destroy_env.yml similarity index 95% rename from ansible/configs/archive/ocp-demo-lab/destroy_env.yml rename to tools/archive/configs/ocp-demo-lab/destroy_env.yml index fb45b804c52..86ff1e56eb4 100644 --- a/ansible/configs/archive/ocp-demo-lab/destroy_env.yml +++ b/tools/archive/configs/ocp-demo-lab/destroy_env.yml @@ -26,7 +26,7 @@ # AWS_ACCESS_KEY_ID: "{{aws_access_key_id}}" # AWS_SECRET_ACCESS_KEY: "{{aws_secret_access_key}}" # AWS_DEFAULT_REGION: "{{aws_region_final|d(aws_region)}}" - # shell: "aws route53 change-resource-record-sets --hosted-zone-id {{internal_zone_id}} --change-batch file://{{ ANSIBLE_REPO_PATH }}/workdir/internal_dns-{{ env_type }}-{{ guid }}_DELETE.json --region={{aws_region_final|d(aws_region)}}" + # shell: "aws route53 change-resource-record-sets --hosted-zone-id {{internal_zone_id}} --change-batch file://{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/internal_dns-{{ env_type }}-{{ guid }}_DELETE.json --region={{aws_region_final|d(aws_region)}}" # ignore_errors: true # tags: # - internal_dns_delete diff --git a/ansible/configs/archive/ocp-demo-lab/env_tests.yml b/tools/archive/configs/ocp-demo-lab/env_tests.yml similarity index 100% rename from ansible/configs/archive/ocp-demo-lab/env_tests.yml rename to tools/archive/configs/ocp-demo-lab/env_tests.yml diff --git a/ansible/configs/archive/ocp-demo-lab/env_vars.yml b/tools/archive/configs/ocp-demo-lab/env_vars.yml similarity index 98% rename from ansible/configs/archive/ocp-demo-lab/env_vars.yml rename to tools/archive/configs/ocp-demo-lab/env_vars.yml index a24637e4ed5..58ef4949651 100644 --- a/ansible/configs/archive/ocp-demo-lab/env_vars.yml +++ b/tools/archive/configs/ocp-demo-lab/env_vars.yml @@ -8,7 +8,7 @@ ###### VARIABLES YOU SHOULD CONFIGURE FOR YOUR DEPLOYEMNT ###### OR PASS as "-e" args to ansible-playbook command install_ipa_client: false -deploy_local_ssh_config_location: "{{ ANSIBLE_REPO_PATH }}/workdir" +deploy_local_ssh_config_location: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir" repo_method: "file" tower_run: false ### Route 53 Zone ID (AWS) diff --git a/ansible/configs/archive/ocp-demo-lab/files/cloud_providers/ec2_cloud_template.j2 b/tools/archive/configs/ocp-demo-lab/files/cloud_providers/ec2_cloud_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-demo-lab/files/cloud_providers/ec2_cloud_template.j2 rename to tools/archive/configs/ocp-demo-lab/files/cloud_providers/ec2_cloud_template.j2 diff --git a/ansible/configs/archive/ocp-demo-lab/files/hosts_template.j2 b/tools/archive/configs/ocp-demo-lab/files/hosts_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-demo-lab/files/hosts_template.j2 rename to tools/archive/configs/ocp-demo-lab/files/hosts_template.j2 diff --git a/ansible/configs/archive/ocp-demo-lab/files/htpasswd.openshift b/tools/archive/configs/ocp-demo-lab/files/htpasswd.openshift similarity index 100% rename from ansible/configs/archive/ocp-demo-lab/files/htpasswd.openshift rename to tools/archive/configs/ocp-demo-lab/files/htpasswd.openshift diff --git a/ansible/configs/archive/ocp-demo-lab/files/logrotate.d_syslog b/tools/archive/configs/ocp-demo-lab/files/logrotate.d_syslog similarity index 100% rename from ansible/configs/archive/ocp-demo-lab/files/logrotate.d_syslog rename to tools/archive/configs/ocp-demo-lab/files/logrotate.d_syslog diff --git a/ansible/configs/archive/ocp-demo-lab/files/project-template.yml b/tools/archive/configs/ocp-demo-lab/files/project-template.yml similarity index 100% rename from ansible/configs/archive/ocp-demo-lab/files/project-template.yml rename to tools/archive/configs/ocp-demo-lab/files/project-template.yml diff --git a/ansible/configs/archive/ocp-demo-lab/files/pvs.j2 b/tools/archive/configs/ocp-demo-lab/files/pvs.j2 similarity index 100% rename from ansible/configs/archive/ocp-demo-lab/files/pvs.j2 rename to tools/archive/configs/ocp-demo-lab/files/pvs.j2 diff --git a/ansible/configs/archive/ocp-demo-lab/files/repos_template.j2 b/tools/archive/configs/ocp-demo-lab/files/repos_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-demo-lab/files/repos_template.j2 rename to tools/archive/configs/ocp-demo-lab/files/repos_template.j2 diff --git a/ansible/configs/archive/ocp-demo-lab/files/userpvs.j2 b/tools/archive/configs/ocp-demo-lab/files/userpvs.j2 similarity index 100% rename from ansible/configs/archive/ocp-demo-lab/files/userpvs.j2 rename to tools/archive/configs/ocp-demo-lab/files/userpvs.j2 diff --git a/ansible/configs/archive/ocp-demo-lab/post_infra.yml b/tools/archive/configs/ocp-demo-lab/post_infra.yml similarity index 100% rename from ansible/configs/archive/ocp-demo-lab/post_infra.yml rename to tools/archive/configs/ocp-demo-lab/post_infra.yml diff --git a/ansible/configs/archive/ocp-demo-lab/post_software.yml b/tools/archive/configs/ocp-demo-lab/post_software.yml similarity index 80% rename from ansible/configs/archive/ocp-demo-lab/post_software.yml rename to tools/archive/configs/ocp-demo-lab/post_software.yml index af049f1e70b..ee70cda1878 100644 --- a/ansible/configs/archive/ocp-demo-lab/post_software.yml +++ b/tools/archive/configs/ocp-demo-lab/post_software.yml @@ -3,7 +3,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: Create user vols shell: "mkdir -p /srv/nfs/user-vols/vol{1..{{user_vols}}}" @@ -15,7 +15,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: get nfs Hostname set_fact: @@ -28,7 +28,7 @@ - name: Generate PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/pvs.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/pvs.j2" dest: "/root//pvs-{{ env_type }}-{{ guid }}.yml" tags: [ gen_pv_file ] @@ -41,7 +41,7 @@ - name: Generate user vol PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/userpvs.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/userpvs.j2" dest: "/root/userpvs-{{ env_type }}-{{ guid }}.yml" tags: - gen_user_vol_pv @@ -55,7 +55,7 @@ become: yes gather_facts: False vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tags: - env-specific - env-specific_infra @@ -86,7 +86,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tags: - env-specific - env_specific_images @@ -126,10 +126,10 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" run_once: true roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-infra-nexus", nexus_project: "{{admin_project}}" } + - { role: "ocp-infra-nexus", nexus_project: "{{admin_project}}" } tags: - env-specific - install_nexus @@ -139,10 +139,10 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" run_once: true roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/dev-workstation", desired_user: "{{dev_user}}" } + - { role: "dev-workstation", desired_user: "{{dev_user}}" } tags: - env-specific - install_dev_workstation @@ -160,8 +160,8 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - post_flight_check tasks: diff --git a/ansible/configs/archive/ocp-demo-lab/pre_infra.yml b/tools/archive/configs/ocp-demo-lab/pre_infra.yml similarity index 100% rename from ansible/configs/archive/ocp-demo-lab/pre_infra.yml rename to tools/archive/configs/ocp-demo-lab/pre_infra.yml diff --git a/ansible/configs/archive/ocp-demo-lab/pre_software.yml b/tools/archive/configs/ocp-demo-lab/pre_software.yml similarity index 60% rename from ansible/configs/archive/ocp-demo-lab/pre_software.yml rename to tools/archive/configs/ocp-demo-lab/pre_software.yml index ad25517034d..f829bc61174 100644 --- a/ansible/configs/archive/ocp-demo-lab/pre_software.yml +++ b/tools/archive/configs/ocp-demo-lab/pre_software.yml @@ -5,16 +5,16 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - step003 - generate_env_keys tasks: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" when: set_env_authorized_key @@ -27,24 +27,24 @@ become: true gather_facts: False vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } + - { role: "bastion", when: 'install_bastion' } tags: - step004 - bastion_tasks @@ -56,7 +56,7 @@ tags: - opentlc_bastion_tasks vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: install ipa client packages yum: @@ -80,8 +80,8 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - flight_check tasks: diff --git a/ansible/configs/archive/ocp-demo-lab/software.yml b/tools/archive/configs/ocp-demo-lab/software.yml similarity index 100% rename from ansible/configs/archive/ocp-demo-lab/software.yml rename to tools/archive/configs/ocp-demo-lab/software.yml diff --git a/ansible/configs/archive/ocp-implementation-lab-2/How.To.Create.Env.Type.adoc b/tools/archive/configs/ocp-implementation-lab-2/How.To.Create.Env.Type.adoc similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab-2/How.To.Create.Env.Type.adoc rename to tools/archive/configs/ocp-implementation-lab-2/How.To.Create.Env.Type.adoc diff --git a/ansible/configs/archive/ocp-implementation-lab-2/README.adoc b/tools/archive/configs/ocp-implementation-lab-2/README.adoc similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab-2/README.adoc rename to tools/archive/configs/ocp-implementation-lab-2/README.adoc diff --git a/ansible/configs/archive/ocp-implementation-lab-2/destroy_env.yml b/tools/archive/configs/ocp-implementation-lab-2/destroy_env.yml similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab-2/destroy_env.yml rename to tools/archive/configs/ocp-implementation-lab-2/destroy_env.yml diff --git a/ansible/configs/archive/ocp-implementation-lab/env_vars.yml b/tools/archive/configs/ocp-implementation-lab-2/env_vars.yml similarity index 98% rename from ansible/configs/archive/ocp-implementation-lab/env_vars.yml rename to tools/archive/configs/ocp-implementation-lab-2/env_vars.yml index f1115614e94..3e1efbddacf 100644 --- a/ansible/configs/archive/ocp-implementation-lab/env_vars.yml +++ b/tools/archive/configs/ocp-implementation-lab-2/env_vars.yml @@ -4,7 +4,7 @@ ## should just toss in group_vars/all. ### Also, we should probably just create a variable reference in the README.md ### For now, just tagging comments in line with configuration file. -deploy_local_ssh_config_location: "{{ ANSIBLE_REPO_PATH }}/workdir" +deploy_local_ssh_config_location: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir" ###### VARIABLES YOU SHOULD CONFIGURE FOR YOUR DEPLOYEMNT ###### OR PASS as "-e" args to ansible-playbook command diff --git a/ansible/configs/archive/ocp-implementation-lab-2/files/cloud_providers/ec2_cloud_template.j2 b/tools/archive/configs/ocp-implementation-lab-2/files/cloud_providers/ec2_cloud_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab-2/files/cloud_providers/ec2_cloud_template.j2 rename to tools/archive/configs/ocp-implementation-lab-2/files/cloud_providers/ec2_cloud_template.j2 diff --git a/ansible/configs/archive/ocp-implementation-lab-2/files/ec2_internal_dns.json.j2 b/tools/archive/configs/ocp-implementation-lab-2/files/ec2_internal_dns.json.j2 similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab-2/files/ec2_internal_dns.json.j2 rename to tools/archive/configs/ocp-implementation-lab-2/files/ec2_internal_dns.json.j2 diff --git a/ansible/configs/archive/ocp-implementation-lab-2/files/hosts_template.j2 b/tools/archive/configs/ocp-implementation-lab-2/files/hosts_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab-2/files/hosts_template.j2 rename to tools/archive/configs/ocp-implementation-lab-2/files/hosts_template.j2 diff --git a/ansible/configs/archive/ocp-implementation-lab-2/files/htpasswd.openshift b/tools/archive/configs/ocp-implementation-lab-2/files/htpasswd.openshift similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab-2/files/htpasswd.openshift rename to tools/archive/configs/ocp-implementation-lab-2/files/htpasswd.openshift diff --git a/ansible/configs/archive/ocp-implementation-lab-2/files/labs_hosts_template.j2 b/tools/archive/configs/ocp-implementation-lab-2/files/labs_hosts_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab-2/files/labs_hosts_template.j2 rename to tools/archive/configs/ocp-implementation-lab-2/files/labs_hosts_template.j2 diff --git a/ansible/configs/archive/ocp-implementation-lab-2/files/pvs.j2 b/tools/archive/configs/ocp-implementation-lab-2/files/pvs.j2 similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab-2/files/pvs.j2 rename to tools/archive/configs/ocp-implementation-lab-2/files/pvs.j2 diff --git a/ansible/configs/archive/ocp-implementation-lab-2/files/repos_template.j2 b/tools/archive/configs/ocp-implementation-lab-2/files/repos_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab-2/files/repos_template.j2 rename to tools/archive/configs/ocp-implementation-lab-2/files/repos_template.j2 diff --git a/ansible/configs/archive/ocp-implementation-lab-2/files/userpvs.j2 b/tools/archive/configs/ocp-implementation-lab-2/files/userpvs.j2 similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab-2/files/userpvs.j2 rename to tools/archive/configs/ocp-implementation-lab-2/files/userpvs.j2 diff --git a/ansible/configs/archive/ocp-implementation-lab-2/post_infra.yml b/tools/archive/configs/ocp-implementation-lab-2/post_infra.yml similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab-2/post_infra.yml rename to tools/archive/configs/ocp-implementation-lab-2/post_infra.yml diff --git a/ansible/configs/archive/ocp-implementation-lab-2/post_software.yml b/tools/archive/configs/ocp-implementation-lab-2/post_software.yml similarity index 64% rename from ansible/configs/archive/ocp-implementation-lab-2/post_software.yml rename to tools/archive/configs/ocp-implementation-lab-2/post_software.yml index 01c179ce051..d1c2ab3d430 100644 --- a/ansible/configs/archive/ocp-implementation-lab-2/post_software.yml +++ b/tools/archive/configs/ocp-implementation-lab-2/post_software.yml @@ -12,8 +12,8 @@ tasks: - name: Overwrite ansible hosts file with lab hosts file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/labs_hosts_template.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/labs_hosts_template.j2" + dest: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" - name: Step lab post software deployment hosts: bastions @@ -22,18 +22,18 @@ tags: - opentlc_bastion_tasks vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: Ensures /etc/ansible dir exists file: path=/etc/ansible state=directory - name: Copy over ansible hosts file copy: backup: yes - src: "{{ ANSIBLE_REPO_PATH }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" dest: /etc/ansible/hosts tags: - overwrite_hosts_with_lab_hosts - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool diff --git a/ansible/configs/archive/ocp-implementation-lab-2/pre_infra.yml b/tools/archive/configs/ocp-implementation-lab-2/pre_infra.yml similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab-2/pre_infra.yml rename to tools/archive/configs/ocp-implementation-lab-2/pre_infra.yml diff --git a/tools/archive/configs/ocp-implementation-lab-2/pre_software.yml b/tools/archive/configs/ocp-implementation-lab-2/pre_software.yml new file mode 100644 index 00000000000..e2d50ff0880 --- /dev/null +++ b/tools/archive/configs/ocp-implementation-lab-2/pre_software.yml @@ -0,0 +1,62 @@ +--- +- name: Step 003 - Create env key + hosts: localhost + connection: local + gather_facts: false + become: false + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + tags: + - step003 + - generate_env_keys + tasks: + - name: Generate SSH keys + shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" -q -N "" + args: + creates: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" + when: set_env_authorized_key + +# Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} + +- name: Configure all hosts with Repositories, Common Files and Set environment key + hosts: + - all:!windows + become: true + gather_facts: False + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + tags: + - step004 + - common_tasks + roles: + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } + +- name: Configuring Bastion Hosts + hosts: bastions + become: true + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + roles: + - { role: "bastion", when: 'install_bastion' } + tags: + - step004 + - bastion_tasks + +- name: PreSoftware flight-check + hosts: localhost + connection: local + gather_facts: false + become: false + vars_files: + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" + tags: + - flight_check + tasks: + - debug: + msg: "Pre-Software checks completed successfully" diff --git a/ansible/configs/archive/ocp-implementation-lab-2/software.yml b/tools/archive/configs/ocp-implementation-lab-2/software.yml similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab-2/software.yml rename to tools/archive/configs/ocp-implementation-lab-2/software.yml diff --git a/ansible/configs/archive/ocp-implementation-lab/How.To.Create.Env.Type.adoc b/tools/archive/configs/ocp-implementation-lab/How.To.Create.Env.Type.adoc similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab/How.To.Create.Env.Type.adoc rename to tools/archive/configs/ocp-implementation-lab/How.To.Create.Env.Type.adoc diff --git a/ansible/configs/archive/ocp-implementation-lab/README.adoc b/tools/archive/configs/ocp-implementation-lab/README.adoc similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab/README.adoc rename to tools/archive/configs/ocp-implementation-lab/README.adoc diff --git a/ansible/configs/archive/ocp-implementation-lab/destroy_env.yml b/tools/archive/configs/ocp-implementation-lab/destroy_env.yml similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab/destroy_env.yml rename to tools/archive/configs/ocp-implementation-lab/destroy_env.yml diff --git a/ansible/configs/archive/ocp-implementation-lab-2/env_vars.yml b/tools/archive/configs/ocp-implementation-lab/env_vars.yml similarity index 98% rename from ansible/configs/archive/ocp-implementation-lab-2/env_vars.yml rename to tools/archive/configs/ocp-implementation-lab/env_vars.yml index f1115614e94..3e1efbddacf 100644 --- a/ansible/configs/archive/ocp-implementation-lab-2/env_vars.yml +++ b/tools/archive/configs/ocp-implementation-lab/env_vars.yml @@ -4,7 +4,7 @@ ## should just toss in group_vars/all. ### Also, we should probably just create a variable reference in the README.md ### For now, just tagging comments in line with configuration file. -deploy_local_ssh_config_location: "{{ ANSIBLE_REPO_PATH }}/workdir" +deploy_local_ssh_config_location: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir" ###### VARIABLES YOU SHOULD CONFIGURE FOR YOUR DEPLOYEMNT ###### OR PASS as "-e" args to ansible-playbook command diff --git a/ansible/configs/archive/ocp-implementation-lab/files/cloud_providers/ec2_cloud_template.j2 b/tools/archive/configs/ocp-implementation-lab/files/cloud_providers/ec2_cloud_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab/files/cloud_providers/ec2_cloud_template.j2 rename to tools/archive/configs/ocp-implementation-lab/files/cloud_providers/ec2_cloud_template.j2 diff --git a/ansible/configs/archive/ocp-implementation-lab/files/ec2_internal_dns.json.j2 b/tools/archive/configs/ocp-implementation-lab/files/ec2_internal_dns.json.j2 similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab/files/ec2_internal_dns.json.j2 rename to tools/archive/configs/ocp-implementation-lab/files/ec2_internal_dns.json.j2 diff --git a/ansible/configs/archive/ocp-implementation-lab/files/hosts_template.j2 b/tools/archive/configs/ocp-implementation-lab/files/hosts_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab/files/hosts_template.j2 rename to tools/archive/configs/ocp-implementation-lab/files/hosts_template.j2 diff --git a/ansible/configs/archive/ocp-implementation-lab/files/htpasswd.openshift b/tools/archive/configs/ocp-implementation-lab/files/htpasswd.openshift similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab/files/htpasswd.openshift rename to tools/archive/configs/ocp-implementation-lab/files/htpasswd.openshift diff --git a/ansible/configs/archive/ocp-implementation-lab/files/labs_hosts_template.j2 b/tools/archive/configs/ocp-implementation-lab/files/labs_hosts_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab/files/labs_hosts_template.j2 rename to tools/archive/configs/ocp-implementation-lab/files/labs_hosts_template.j2 diff --git a/ansible/configs/archive/ocp-implementation-lab/files/pvs.j2 b/tools/archive/configs/ocp-implementation-lab/files/pvs.j2 similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab/files/pvs.j2 rename to tools/archive/configs/ocp-implementation-lab/files/pvs.j2 diff --git a/ansible/configs/archive/ocp-implementation-lab/files/repos_template.j2 b/tools/archive/configs/ocp-implementation-lab/files/repos_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab/files/repos_template.j2 rename to tools/archive/configs/ocp-implementation-lab/files/repos_template.j2 diff --git a/ansible/configs/archive/ocp-implementation-lab/files/userpvs.j2 b/tools/archive/configs/ocp-implementation-lab/files/userpvs.j2 similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab/files/userpvs.j2 rename to tools/archive/configs/ocp-implementation-lab/files/userpvs.j2 diff --git a/ansible/configs/archive/ocp-implementation-lab/post_infra.yml b/tools/archive/configs/ocp-implementation-lab/post_infra.yml similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab/post_infra.yml rename to tools/archive/configs/ocp-implementation-lab/post_infra.yml diff --git a/ansible/configs/archive/ocp-implementation-lab/post_software.yml b/tools/archive/configs/ocp-implementation-lab/post_software.yml similarity index 72% rename from ansible/configs/archive/ocp-implementation-lab/post_software.yml rename to tools/archive/configs/ocp-implementation-lab/post_software.yml index 7323a8f7d3a..9860ae81d79 100644 --- a/ansible/configs/archive/ocp-implementation-lab/post_software.yml +++ b/tools/archive/configs/ocp-implementation-lab/post_software.yml @@ -12,8 +12,8 @@ tasks: - name: Overwrite ansible hosts file with lab hosts file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/labs_hosts_template.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/labs_hosts_template.j2" + dest: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" - name: Step lab post software deployment hosts: bastions @@ -22,14 +22,14 @@ tags: - opentlc_bastion_tasks vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: Ensures /etc/ansible dir exists file: path=/etc/ansible state=directory - name: Copy over ansible hosts file copy: backup: yes - src: "{{ ANSIBLE_REPO_PATH }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/labs_hosts-{{ env_type }}-{{ guid }}" dest: /etc/ansible/hosts tags: - overwrite_hosts_with_lab_hosts diff --git a/ansible/configs/archive/ocp-implementation-lab/pre_infra.yml b/tools/archive/configs/ocp-implementation-lab/pre_infra.yml similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab/pre_infra.yml rename to tools/archive/configs/ocp-implementation-lab/pre_infra.yml diff --git a/ansible/configs/archive/ocp-implementation-lab/pre_software.yml b/tools/archive/configs/ocp-implementation-lab/pre_software.yml similarity index 60% rename from ansible/configs/archive/ocp-implementation-lab/pre_software.yml rename to tools/archive/configs/ocp-implementation-lab/pre_software.yml index 18d6b932f85..4864f981c71 100644 --- a/ansible/configs/archive/ocp-implementation-lab/pre_software.yml +++ b/tools/archive/configs/ocp-implementation-lab/pre_software.yml @@ -5,16 +5,16 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - step003 - generate_env_keys tasks: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" when: set_env_authorized_key # Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} @@ -25,24 +25,24 @@ become: true gather_facts: False vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: Configuring Bastion Hosts hosts: bastions become: true vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } + - { role: "bastion", when: 'install_bastion' } tags: - step004 - bastion_tasks @@ -54,7 +54,7 @@ tags: - opentlc_bastion_tasks vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: install ipa client packages yum: @@ -78,8 +78,8 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - flight_check tasks: diff --git a/ansible/configs/archive/ocp-implementation-lab/software.yml b/tools/archive/configs/ocp-implementation-lab/software.yml similarity index 100% rename from ansible/configs/archive/ocp-implementation-lab/software.yml rename to tools/archive/configs/ocp-implementation-lab/software.yml diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/README.adoc b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/README.adoc similarity index 94% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/README.adoc rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/README.adoc index 9f404b8ae9c..87f7598a920 100644 --- a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/README.adoc +++ b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/README.adoc @@ -43,7 +43,7 @@ zabbix_auto_registration_pass: "XXXXX" === Add new users on the bastion -For managing users on the bastion, you can override the `mgr_users` variable. The default is located in `{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/mgr_users.yml`, and looks like : +For managing users on the bastion, you can override the `mgr_users` variable. The default is located in `{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/mgr_users.yml`, and looks like : .Default mgr_users.yml [source,yaml] @@ -99,7 +99,7 @@ ansible-playbook main.yml -e "guid=${GUID}" -e "env_type=${ENVTYPE}" \ -e "nfs_instance_type=m3.large" -e "node_instance_count=5" \ -e "email=name@example.com" \ -e "install_idm=htpasswd" -e "software_to_deploy=openshift" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" -e "own_repo_path=${REPO_PATH}" --skip-tags=remove_self_provisioners + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" -e "own_repo_path=${REPO_PATH}" --skip-tags=remove_self_provisioners ---- @@ -134,7 +134,7 @@ ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \ -e "repo_method=satellite" -e "repo_version=${REPO_VERSION}" \ -e "email=name@example.com" \ -e "software_to_deploy=openshift" -e "osrelease=3.5.5.15" -e "docker_version=1.12.6" \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE ---- === Advanced Development Workshop @@ -161,7 +161,7 @@ ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \ -e "nfs_instance_type=t2.large" -e "node_instance_count=${NODE_COUNT}" \ -e "install_idm=htpasswd" -e "software_to_deploy=openshift" \ -e "email=name@example.com" \ - -e "own_repo_path=${REPO_PATH}" -e"repo_method=rhn" -e"ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "own_repo_path=${REPO_PATH}" -e"repo_method=rhn" -e"ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "osrelease=3.5.5.31" -e "repo_version=${REPO_VERSION}" -e "docker_version=1.12.6" \ --skip-tags=remove_self_provisioners,opentlc-integration ---- @@ -200,7 +200,7 @@ REPO_VERSION=3.5 NODE_COUNT=4 NEW_NODE_COUNT=2 ansible-playbook ./configs/${ENVTYPE}/scaleup.yml \ - -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" \ + -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" \ -e "HostedZoneId=${HOSTZONEID}" \ -e "bastion_instance_type=t2.large" \ -e "cloud_provider=${CLOUDPROVIDER}" \ diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/destroy_env.yml b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/destroy_env.yml similarity index 95% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/destroy_env.yml rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/destroy_env.yml index beb9078c204..717d5f38f88 100644 --- a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/destroy_env.yml +++ b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/destroy_env.yml @@ -64,5 +64,5 @@ ## we need to add something to delete the env specific key. - name: Import default azure destroy playbook - import_playbook: "{{ANSIBLE_REPO_PATH}}/cloud_providers/azure_destroy_env.yml" + import_playbook: "{{ANSIBLE_REPO_PATH | default('.')}}/cloud_providers/azure_destroy_env.yml" when: cloud_provider == 'azure' diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/env_tests.yml b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/env_tests.yml similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/env_tests.yml rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/env_tests.yml diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/env_vars.yml b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/env_vars.yml similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/env_vars.yml rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/env_vars.yml diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/cloud_providers/azure_cloud_template.j2 b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/cloud_providers/azure_cloud_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/cloud_providers/azure_cloud_template.j2 rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/cloud_providers/azure_cloud_template.j2 diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/cloud_providers/ec2_cloud_template.j2 b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/cloud_providers/ec2_cloud_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/cloud_providers/ec2_cloud_template.j2 rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/cloud_providers/ec2_cloud_template.j2 diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/ec2_internal_dns.json.j2.not_required_any_more b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/ec2_internal_dns.json.j2.not_required_any_more similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/ec2_internal_dns.json.j2.not_required_any_more rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/ec2_internal_dns.json.j2.not_required_any_more diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/env_infra_template.j2 b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/env_infra_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/env_infra_template.j2 rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/env_infra_template.j2 diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.14.j2 b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.14.j2 similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.14.j2 rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.14.j2 diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.25.j2 b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.25.j2 similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.25.j2 rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.25.j2 diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.27.j2 b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.27.j2 similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.27.j2 rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.27.j2 diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.30.j2 b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.30.j2 similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.30.j2 rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.30.j2 diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.31.j2 b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.31.j2 similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.31.j2 rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.3.9.31.j2 diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.j2 b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.j2 rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/hosts_template.j2 diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/htpasswd.openshift b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/htpasswd.openshift similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/htpasswd.openshift rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/htpasswd.openshift diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/lets-encrypt-x3-cross-signed.pem.txt b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/lets-encrypt-x3-cross-signed.pem.txt similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/lets-encrypt-x3-cross-signed.pem.txt rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/lets-encrypt-x3-cross-signed.pem.txt diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/logrotate.d_syslog b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/logrotate.d_syslog similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/logrotate.d_syslog rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/logrotate.d_syslog diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/ocp_report.adoc.j2 b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/ocp_report.adoc.j2 similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/ocp_report.adoc.j2 rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/ocp_report.adoc.j2 diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/project-template.yml b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/project-template.yml similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/project-template.yml rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/project-template.yml diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/pvs.j2 b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/pvs.j2 similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/pvs.j2 rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/pvs.j2 diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/repos_template.j2 b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/repos_template.j2 similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/repos_template.j2 rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/repos_template.j2 diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/userpvs.j2 b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/userpvs.j2 similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/files/userpvs.j2 rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/files/userpvs.j2 diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/mgr_users.yml b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/mgr_users.yml similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/mgr_users.yml rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/mgr_users.yml diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/post_infra.yml b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/post_infra.yml similarity index 92% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/post_infra.yml rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/post_infra.yml index b2a76226d80..a4801504d86 100644 --- a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/post_infra.yml +++ b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/post_infra.yml @@ -3,8 +3,8 @@ connection: local become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - step002 - post_infrastructure @@ -41,7 +41,7 @@ - name: write down s3user credentials copy: - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.s3user.credentials" + dest: "{{ANSIBLE_REPO_PATH | default('.')}}/workdir/{{ env_type }}.{{ guid }}.s3user.credentials" content: | * S3 Bucket for registry: {{s3user}} ** S3User access key: {{s3user_access_key}} @@ -62,7 +62,7 @@ - name: write down Route53User credentials copy: - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{ env_type }}.{{ guid }}.route53user.credentials" + dest: "{{ANSIBLE_REPO_PATH | default('.')}}/workdir/{{ env_type }}.{{ guid }}.route53user.credentials" content: | * Route53 User for Let's Encrypt: {{ route53user }} ** Route53User access key: {{ route53user_access_key }} @@ -75,8 +75,8 @@ become: true gather_facts: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tasks: - name: test if docker_device file is present (previous run) stat: @@ -274,8 +274,8 @@ become: true gather_facts: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tasks: - name: test if docker_device file is present (previous run) stat: @@ -339,8 +339,8 @@ become: true gather_facts: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tasks: - name: test if docker_device file is present (previous run) stat: @@ -404,8 +404,8 @@ become: true gather_facts: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tasks: - name: test if docker_device file is present (previous run) stat: diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/post_software.yml b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/post_software.yml similarity index 79% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/post_software.yml rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/post_software.yml index e97fbec94f7..3e90e93c417 100644 --- a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/post_software.yml +++ b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/post_software.yml @@ -4,7 +4,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: Create user vols shell: "mkdir -p /srv/nfs/user-vols/vol{1..{{user_vols}}}" @@ -17,9 +17,9 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/openshift-ansible-broker" + - role: "openshift-ansible-broker" tasks: - name: get nfs Hostname set_fact: @@ -32,7 +32,7 @@ - name: Generate PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/pvs.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/pvs.j2" dest: "/root/pvs-{{ env_type }}-{{ guid }}.yml" tags: [ gen_pv_file ] when: pv_list.0 is defined @@ -46,7 +46,7 @@ - name: Generate user vol PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/userpvs.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/userpvs.j2" dest: "/root/userpvs-{{ env_type }}-{{ guid }}.yml" tags: - gen_user_vol_pv @@ -66,7 +66,7 @@ become: yes gather_facts: False vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tags: - env-specific - env-specific_infra @@ -101,15 +101,15 @@ become: yes gather_facts: False vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/mgr_users.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/mgr_users.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - env-specific - cf_integration - opentlc_integration roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/opentlc-integration" + - role: "opentlc-integration" when: install_opentlc_integration no_log: yes tasks: @@ -131,7 +131,7 @@ become: yes gather_facts: False vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tags: - env-specific - env-specific_infra @@ -175,7 +175,7 @@ become: yes gather_facts: False vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tags: [ env-specific, remove_self_provisioners ] tasks: - when: remove_self_provisioners|bool @@ -199,7 +199,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tags: - env-specific - project_request @@ -254,7 +254,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tags: - env-specific - env_specific_images @@ -270,7 +270,7 @@ become: yes gather_facts: False vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tags: - env-specific - env_specific_images @@ -317,7 +317,7 @@ hosts: masters run_once: true vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: Patch dockergc DaemonSet shell: "oc patch daemonset dockergc --patch='\"spec\": { \"template\": { \"spec\": { \"containers\": [ { \"command\": [ \"/usr/bin/oc\" ], \"name\": \"dockergc\" } ] } } }' -n default" @@ -340,13 +340,13 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tags: - env-specific - install_openwhisk tasks: - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/install-openwhisk" + name: "install-openwhisk" when: - install_openwhisk|bool @@ -361,13 +361,13 @@ - masters - bastions vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - install_prometheus tasks: - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/install-prometheus" + name: "install-prometheus" when: install_prometheus|bool - name: Install Nexus @@ -376,9 +376,9 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/ocp-infra-nexus", nexus_project: "{{admin_project}}" } + - { role: "ocp-infra-nexus", nexus_project: "{{admin_project}}" } tags: - env-specific - install_nexus @@ -389,13 +389,13 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tags: - env-specific - install_aws_broker tasks: - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/install-aws-broker" + name: "install-aws-broker" when: - install_aws_broker|bool @@ -404,16 +404,16 @@ gather_facts: true become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" vars: zabbix_auto_registration_keyword: OCP Master roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client" + - role: "zabbix-client" when: install_zabbix - - role: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client-openshift-master" + - role: "zabbix-client-openshift-master" when: install_zabbix - - role: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client-openshift-node" + - role: "zabbix-client-openshift-node" when: install_zabbix tags: - env-specific @@ -426,16 +426,16 @@ gather_facts: true become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" vars: zabbix_auto_registration_keyword: OCP Node zabbix_token: "{{ hostvars[groups['masters'][0]].zabbix_token }}" hawkular_route: "{{ hostvars[groups['masters'][0]].hawkular_route }}" roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client" + - role: "zabbix-client" when: install_zabbix - - role: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client-openshift-node" + - role: "zabbix-client-openshift-node" when: install_zabbix tags: - env-specific @@ -448,12 +448,12 @@ gather_facts: true become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" vars: zabbix_auto_registration_keyword: OCP Host roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/zabbix-client" + - role: "zabbix-client" when: install_zabbix tags: - env-specific @@ -465,8 +465,8 @@ gather_facts: False run_once: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tasks: # start supporting this only for OCP >= 3.9 - when: @@ -497,7 +497,7 @@ - name: Fetch the diagnostic archive and logs fetch: src: /tmp/diagnostics.tar.gz - dest: "{{ANSIBLE_REPO_PATH}}/workdir/{{project_tag}}_diagnostics.tar.gz" + dest: "{{ANSIBLE_REPO_PATH | default('.')}}/workdir/{{project_tag}}_diagnostics.tar.gz" flat: true - name: Report diagnostics failure @@ -511,11 +511,11 @@ gather_facts: False run_once: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tasks: - import_role: - name: "{{ ANSIBLE_REPO_PATH }}/roles/bastion-opentlc-ipa" + name: "bastion-opentlc-ipa" when: install_ipa_client|bool - name: PostSoftware flight-check @@ -524,8 +524,8 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - post_flight_check tasks: @@ -536,8 +536,8 @@ hosts: - all vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" gather_facts: true tags: - ocp_report @@ -548,8 +548,8 @@ become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - ocp_report vars: @@ -558,7 +558,7 @@ - name: get repo version used to deploy command: git rev-parse HEAD args: - chdir: "{{ ANSIBLE_REPO_PATH }}" + chdir: "{{ ANSIBLE_REPO_PATH | default('.') }}" register: ansible_agnostic_deployer_head - name: Gather ec2 facts @@ -571,8 +571,8 @@ - cloud_provider == 'ec2' - name: Generate report template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/ocp_report.adoc.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/ocp_report_{{ env_type }}-{{ guid }}.adoc" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/ocp_report.adoc.j2" + dest: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/ocp_report_{{ env_type }}-{{ guid }}.adoc" when: - ocp_report - cloud_provider == 'ec2' diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/pre_infra.yml b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/pre_infra.yml similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/pre_infra.yml rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/pre_infra.yml diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/pre_software.yml b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/pre_software.yml similarity index 63% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/pre_software.yml rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/pre_software.yml index b0109f1b9af..f5698f273e9 100644 --- a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/pre_software.yml +++ b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/pre_software.yml @@ -5,28 +5,28 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - step003 - generate_env_keys tasks: - name: Generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" -q -N "" + shell: ssh-keygen -b 2048 -t rsa -f "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" -q -N "" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + creates: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" when: set_env_authorized_key - name: fix permission file: - path: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" + path: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" mode: 0400 when: set_env_authorized_key - name: Generate SSH pub key - shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + shell: ssh-keygen -y -f "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}" > "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}.pub" args: - creates: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key}}.pub" + creates: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key}}.pub" when: set_env_authorized_key # Cloudformation template or equivalent should tag all hosts with Project:{{ env_type }}-{{ guid }} @@ -37,8 +37,8 @@ become: true gather_facts: False vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - step004 - common_tasks @@ -61,11 +61,11 @@ - osrelease is version_compare('3.9', '>=') - osrelease is version_compare('3.11', '<') roles: - - role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories" + - role: "set-repositories" when: repo_method is defined - - role: "{{ ANSIBLE_REPO_PATH }}/roles/common" + - role: "common" when: install_common|bool - - role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key" + - role: "set_env_authorized_key" when: set_env_authorized_key|bool # - name: Install Let's Encrypt Wildcard Certificates @@ -74,11 +74,11 @@ # become: true # gather_facts: false # vars_files: -# - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" +# - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" # tasks: # - name: Create Let's Encrypt Certificates # include_role: -# name: "{{ ANSIBLE_REPO_PATH }}/roles/host-lets-encrypt-certs" +# name: "host-lets-encrypt-certs" # vars: # - acme_domain: "{{ master_lb_dns }}" # - acme_wildcard_domain: "*.{{ cloudapps_suffix }}" @@ -86,9 +86,9 @@ # - acme_aws_secret_access_key: "{{ hostvars['localhost'].route53user_secret_access_key }}" # - acme_production: "{{ lets_encrypt_production|d(False)|bool}}" # - acme_remote_dir: "/root" - # - acme_cache_cert_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}.cert" - # - acme_cache_key_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}.key" - # - acme_cache_archive_file: "{{ANSIBLE_REPO_PATH}}/workdir/{{guid}}_acme.tgz" + # - acme_cache_cert_file: "{{ANSIBLE_REPO_PATH | default('.')}}/workdir/{{guid}}.cert" + # - acme_cache_key_file: "{{ANSIBLE_REPO_PATH | default('.')}}/workdir/{{guid}}.key" + # - acme_cache_archive_file: "{{ANSIBLE_REPO_PATH | default('.')}}/workdir/{{guid}}_acme.tgz" # - acme_renew_automatically: True # - acme_force_issue: False # when: @@ -99,10 +99,10 @@ become: true gather_facts: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/bastion", when: 'install_bastion' } + - { role: "bastion", when: 'install_bastion' } tags: - step004 - bastion_tasks @@ -113,8 +113,8 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - flight_check tasks: @@ -126,7 +126,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tags: - env-specific - project_request diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/scaleup.yml b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/scaleup.yml similarity index 68% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/scaleup.yml rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/scaleup.yml index 43fab135d3f..45b6768d084 100644 --- a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/scaleup.yml +++ b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/scaleup.yml @@ -7,7 +7,7 @@ ################################################################################ ################################################################################ -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/pre_infra.yml" +- import_playbook: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/pre_infra.yml" tags: - step000 - pre_infra_tasks @@ -18,7 +18,7 @@ ################################################################################# ################################################################################# -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/cloud_providers/{{ cloud_provider }}_infrastructure_deployment.yml" +- import_playbook: "{{ ANSIBLE_REPO_PATH | default('.') }}/cloud_providers/{{ cloud_provider }}_infrastructure_deployment.yml" tags: - step001 - deploy_infrastructure @@ -29,7 +29,7 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: Assert new_node_instance_count and node_instance_count are setup properly. tags: assert_new_node @@ -48,7 +48,7 @@ ################################################################################# ################################################################################# -- import_playbook: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/post_infra.yml" +- import_playbook: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/post_infra.yml" tags: - step002 - post_infra_tasks @@ -67,15 +67,15 @@ become: true gather_facts: False vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - step004 - common_tasks roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set-repositories", when: 'repo_method is defined' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/common", when: 'install_common' } - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/set_env_authorized_key", when: 'set_env_authorized_key' } + - { role: "set-repositories", when: 'repo_method is defined' } + - { role: "common", when: 'install_common' } + - { role: "set_env_authorized_key", when: 'set_env_authorized_key' } - name: PreSoftware flight-check @@ -84,8 +84,8 @@ gather_facts: false become: false vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - flight_check tasks: @@ -99,12 +99,12 @@ become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" hosts: - "newnodes" roles: - - "{{ ANSIBLE_REPO_PATH }}/roles/openshift-node" + - "openshift-node" tags: - openshift_node_tasks @@ -113,22 +113,22 @@ become: true gather_facts: False vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - openshift_host_templates tasks: - name: generate ansible hosts file, keep it under workdir template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/hosts_template.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/scaleup_hosts-{{ env_type }}-{{ guid }}" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/hosts_template.j2" + dest: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/scaleup_hosts-{{ env_type }}-{{ guid }}" delegate_to: localhost become: false tags: - generate_ansible_hosts_file - name: Copy over ansible hosts file copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/scaleup_hosts-{{ env_type }}-{{ guid }}" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/scaleup_hosts-{{ env_type }}-{{ guid }}" dest: /etc/ansible/scaleup_hosts ## Run Scaleup playbook @@ -138,7 +138,7 @@ become: yes hosts: bastions[0] vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tags: - installing_openshift ## Change to scale up, and change inventory file @@ -159,8 +159,8 @@ become: False gather_facts: False vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - generate_ansible_hosts_file tasks: @@ -178,8 +178,8 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" hosts: newnodes tasks: - group: @@ -192,8 +192,8 @@ become: true gather_facts: False vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tags: - openshift_host_templates tasks: @@ -203,8 +203,8 @@ - name: generate ansible hosts file, keep it under workdir template: - src: "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/files/hosts_template.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ env_type }}-{{ guid }}" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/files/hosts_template.j2" + dest: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/hosts-{{ env_type }}-{{ guid }}" delegate_to: localhost become: false tags: @@ -212,6 +212,6 @@ - name: Copy over ansible hosts file copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/hosts-{{ project_tag }}" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/hosts-{{ project_tag }}" dest: /etc/ansible/hosts backup: yes diff --git a/ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/software.yml b/tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/software.yml similarity index 100% rename from ansible/configs/archive/ocp-storage-cns_based_on_ocp-workshop/software.yml rename to tools/archive/configs/ocp-storage-cns_based_on_ocp-workshop/software.yml diff --git a/ansible/configs/archive/opentlc-shared/README.adoc b/tools/archive/configs/opentlc-shared/README.adoc similarity index 100% rename from ansible/configs/archive/opentlc-shared/README.adoc rename to tools/archive/configs/opentlc-shared/README.adoc diff --git a/ansible/configs/archive/opentlc-shared/destroy_env.yml b/tools/archive/configs/opentlc-shared/destroy_env.yml similarity index 95% rename from ansible/configs/archive/opentlc-shared/destroy_env.yml rename to tools/archive/configs/opentlc-shared/destroy_env.yml index c799651045d..78068244ad1 100644 --- a/ansible/configs/archive/opentlc-shared/destroy_env.yml +++ b/tools/archive/configs/opentlc-shared/destroy_env.yml @@ -26,7 +26,7 @@ AWS_ACCESS_KEY_ID: "{{aws_access_key_id}}" AWS_SECRET_ACCESS_KEY: "{{aws_secret_access_key}}" AWS_DEFAULT_REGION: "{{aws_region_final|d(aws_region)}}" - shell: "aws route53 change-resource-record-sets --hosted-zone-id {{internal_zone_id}} --change-batch file://{{ ANSIBLE_REPO_PATH }}/workdir/internal_dns-{{ env_type }}-{{ guid }}_DELETE.json --region={{aws_region}}" + shell: "aws route53 change-resource-record-sets --hosted-zone-id {{internal_zone_id}} --change-batch file://{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/internal_dns-{{ env_type }}-{{ guid }}_DELETE.json --region={{aws_region}}" ignore_errors: true tags: - internal_dns_delete diff --git a/ansible/configs/archive/opentlc-shared/env_tests.yml b/tools/archive/configs/opentlc-shared/env_tests.yml similarity index 100% rename from ansible/configs/archive/opentlc-shared/env_tests.yml rename to tools/archive/configs/opentlc-shared/env_tests.yml diff --git a/ansible/configs/archive/opentlc-shared/env_vars.yml b/tools/archive/configs/opentlc-shared/env_vars.yml similarity index 100% rename from ansible/configs/archive/opentlc-shared/env_vars.yml rename to tools/archive/configs/opentlc-shared/env_vars.yml diff --git a/ansible/configs/archive/opentlc-shared/files/cloud_providers/ec2_cloud_template.j2 b/tools/archive/configs/opentlc-shared/files/cloud_providers/ec2_cloud_template.j2 similarity index 100% rename from ansible/configs/archive/opentlc-shared/files/cloud_providers/ec2_cloud_template.j2 rename to tools/archive/configs/opentlc-shared/files/cloud_providers/ec2_cloud_template.j2 diff --git a/ansible/configs/archive/opentlc-shared/files/ec2_internal_dns.json.j2 b/tools/archive/configs/opentlc-shared/files/ec2_internal_dns.json.j2 similarity index 100% rename from ansible/configs/archive/opentlc-shared/files/ec2_internal_dns.json.j2 rename to tools/archive/configs/opentlc-shared/files/ec2_internal_dns.json.j2 diff --git a/ansible/configs/archive/opentlc-shared/files/hosts_template.j2 b/tools/archive/configs/opentlc-shared/files/hosts_template.j2 similarity index 100% rename from ansible/configs/archive/opentlc-shared/files/hosts_template.j2 rename to tools/archive/configs/opentlc-shared/files/hosts_template.j2 diff --git a/ansible/configs/archive/opentlc-shared/files/htpasswd.openshift b/tools/archive/configs/opentlc-shared/files/htpasswd.openshift similarity index 100% rename from ansible/configs/archive/opentlc-shared/files/htpasswd.openshift rename to tools/archive/configs/opentlc-shared/files/htpasswd.openshift diff --git a/ansible/configs/archive/opentlc-shared/files/logrotate.d_syslog b/tools/archive/configs/opentlc-shared/files/logrotate.d_syslog similarity index 100% rename from ansible/configs/archive/opentlc-shared/files/logrotate.d_syslog rename to tools/archive/configs/opentlc-shared/files/logrotate.d_syslog diff --git a/ansible/configs/archive/opentlc-shared/files/project-template.yml b/tools/archive/configs/opentlc-shared/files/project-template.yml similarity index 100% rename from ansible/configs/archive/opentlc-shared/files/project-template.yml rename to tools/archive/configs/opentlc-shared/files/project-template.yml diff --git a/ansible/configs/archive/opentlc-shared/files/pvs.j2 b/tools/archive/configs/opentlc-shared/files/pvs.j2 similarity index 100% rename from ansible/configs/archive/opentlc-shared/files/pvs.j2 rename to tools/archive/configs/opentlc-shared/files/pvs.j2 diff --git a/ansible/configs/archive/opentlc-shared/files/repos_template.j2 b/tools/archive/configs/opentlc-shared/files/repos_template.j2 similarity index 100% rename from ansible/configs/archive/opentlc-shared/files/repos_template.j2 rename to tools/archive/configs/opentlc-shared/files/repos_template.j2 diff --git a/ansible/configs/archive/opentlc-shared/files/userpvs.j2 b/tools/archive/configs/opentlc-shared/files/userpvs.j2 similarity index 100% rename from ansible/configs/archive/opentlc-shared/files/userpvs.j2 rename to tools/archive/configs/opentlc-shared/files/userpvs.j2 diff --git a/ansible/configs/archive/opentlc-shared/post_infra.yml b/tools/archive/configs/opentlc-shared/post_infra.yml similarity index 100% rename from ansible/configs/archive/opentlc-shared/post_infra.yml rename to tools/archive/configs/opentlc-shared/post_infra.yml diff --git a/ansible/configs/archive/opentlc-shared/post_software.yml b/tools/archive/configs/opentlc-shared/post_software.yml similarity index 90% rename from ansible/configs/archive/opentlc-shared/post_software.yml rename to tools/archive/configs/opentlc-shared/post_software.yml index 78219dd4f72..f0921cfe3fa 100644 --- a/ansible/configs/archive/opentlc-shared/post_software.yml +++ b/tools/archive/configs/opentlc-shared/post_software.yml @@ -3,7 +3,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: Create user vols shell: "mkdir -p /srv/nfs/user-vols/vol{1..{{user_vols}}}" @@ -15,7 +15,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: get nfs Hostname set_fact: @@ -31,7 +31,7 @@ - name: Generate PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/files/pvs.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/files/pvs.j2" dest: "/root//pvs-{{ env_type }}-{{ guid }}.yml" tags: [ gen_pv_file ] @@ -56,7 +56,7 @@ - name: Generate user vol PV file template: - src: "{{ ANSIBLE_REPO_PATH }}/files/userpvs.j2" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/files/userpvs.j2" dest: "/root/userpvs-{{ env_type }}-{{ guid }}.yml" tags: - gen_user_vol_pv @@ -70,7 +70,7 @@ become: yes gather_facts: False vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tags: [ env-specific, cf_integration ] tasks: # This requires password :( @@ -102,7 +102,7 @@ become: yes gather_facts: False vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tags: - env-specific - env-specific_infra @@ -133,7 +133,7 @@ become: yes gather_facts: False vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tags: [ env-specific, remove_self_provisioners ] tasks: @@ -151,7 +151,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tags: - env-specific - project_request @@ -199,7 +199,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tags: - env-specific - env_specific_images @@ -237,10 +237,10 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" run_once: true roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/nexus2-container", desired_project: "{{admin_project}}" } + - { role: "nexus2-container", desired_project: "{{admin_project}}" } tags: - env-specific - install_nexus diff --git a/ansible/configs/archive/opentlc-shared/pre_infra.yml b/tools/archive/configs/opentlc-shared/pre_infra.yml similarity index 100% rename from ansible/configs/archive/opentlc-shared/pre_infra.yml rename to tools/archive/configs/opentlc-shared/pre_infra.yml diff --git a/ansible/configs/archive/opentlc-shared/pre_software.yml b/tools/archive/configs/opentlc-shared/pre_software.yml similarity index 84% rename from ansible/configs/archive/opentlc-shared/pre_software.yml rename to tools/archive/configs/opentlc-shared/pre_software.yml index b3761e0ae03..995a8e2fd63 100644 --- a/ansible/configs/archive/opentlc-shared/pre_software.yml +++ b/tools/archive/configs/opentlc-shared/pre_software.yml @@ -18,7 +18,7 @@ - name: create file for internal dns names template: src: "./files/{{cloud_provider}}_internal_dns.json.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/internal_dns-{{ env_type }}-{{ guid }}.json" + dest: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/internal_dns-{{ env_type }}-{{ guid }}.json" tags: - internal_dns_creation @@ -29,7 +29,7 @@ - name: create Delete file for internal dns names template: src: "./files/{{cloud_provider}}_internal_dns.json.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/internal_dns-{{ env_type }}-{{ guid }}_DELETE.json" + dest: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/internal_dns-{{ env_type }}-{{ guid }}_DELETE.json" tags: - internal_dns_creation @@ -54,7 +54,7 @@ AWS_ACCESS_KEY_ID: "{{aws_access_key_id}}" AWS_SECRET_ACCESS_KEY: "{{aws_secret_access_key}}" AWS_DEFAULT_REGION: "{{aws_region}}" - shell: "aws route53 change-resource-record-sets --hosted-zone-id {{internal_zone_id}} --change-batch file://{{ ANSIBLE_REPO_PATH }}/workdir/internal_dns-{{ env_type }}-{{ guid }}.json --region={{aws_region}}" + shell: "aws route53 change-resource-record-sets --hosted-zone-id {{internal_zone_id}} --change-batch file://{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/internal_dns-{{ env_type }}-{{ guid }}.json --region={{aws_region}}" ignore_errors: true tags: - internal_dns_creation diff --git a/ansible/configs/archive/opentlc-shared/ssh_vars.yml b/tools/archive/configs/opentlc-shared/ssh_vars.yml similarity index 100% rename from ansible/configs/archive/opentlc-shared/ssh_vars.yml rename to tools/archive/configs/opentlc-shared/ssh_vars.yml diff --git a/ansible/configs/archive/ravello-bastion-setup/How.To.Create.Env.Type.adoc b/tools/archive/configs/ravello-bastion-setup/How.To.Create.Env.Type.adoc similarity index 100% rename from ansible/configs/archive/ravello-bastion-setup/How.To.Create.Env.Type.adoc rename to tools/archive/configs/ravello-bastion-setup/How.To.Create.Env.Type.adoc diff --git a/ansible/configs/archive/ravello-bastion-setup/README.adoc b/tools/archive/configs/ravello-bastion-setup/README.adoc similarity index 100% rename from ansible/configs/archive/ravello-bastion-setup/README.adoc rename to tools/archive/configs/ravello-bastion-setup/README.adoc diff --git a/ansible/configs/archive/ravello-bastion-setup/add_hosts_ssh_config.yml b/tools/archive/configs/ravello-bastion-setup/add_hosts_ssh_config.yml similarity index 69% rename from ansible/configs/archive/ravello-bastion-setup/add_hosts_ssh_config.yml rename to tools/archive/configs/ravello-bastion-setup/add_hosts_ssh_config.yml index 2e0dc745058..b5c21e96604 100644 --- a/ansible/configs/archive/ravello-bastion-setup/add_hosts_ssh_config.yml +++ b/tools/archive/configs/ravello-bastion-setup/add_hosts_ssh_config.yml @@ -2,18 +2,18 @@ - name: Add all hosts to workdir ssh config file hosts: localhost vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tasks: - name: Add webserver hosts to workdir ssh config file blockinfile: - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" + dest: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf" marker: "##### {mark} ADDED Node Proxy Config {{ item }} {{ env_type }}-{{ guid }} ######" block: | Host {{ item }} Hostname {{ item }} User {{ remote_user }} - IdentityFile {{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }} + IdentityFile {{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{ env_authorized_key }} ProxyCommand ssh {{ remote_user }}@{{ bastion_hostname.external }} -W %h:%p StrictHostKeyChecking no with_items: " {{ ravello_groups | json_query('web_server.hosts') }}" diff --git a/ansible/configs/archive/ravello-bastion-setup/destroy_env.yml b/tools/archive/configs/ravello-bastion-setup/destroy_env.yml similarity index 88% rename from ansible/configs/archive/ravello-bastion-setup/destroy_env.yml rename to tools/archive/configs/ravello-bastion-setup/destroy_env.yml index 722be7ffedc..bc922a98aea 100644 --- a/ansible/configs/archive/ravello-bastion-setup/destroy_env.yml +++ b/tools/archive/configs/ravello-bastion-setup/destroy_env.yml @@ -34,7 +34,7 @@ command: >- aws route53 change-resource-record-sets --hosted-zone-id {{internal_zone_id}} - --change-batch file://{{ ANSIBLE_REPO_PATH }}/workdir/internal_dns-{{ env_type }}-{{ guid }}_DELETE.json + --change-batch file://{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/internal_dns-{{ env_type }}-{{ guid }}_DELETE.json --region={{aws_region_final|d(aws_region)}} ignore_errors: true tags: @@ -47,7 +47,7 @@ state: "absent" region: "{{aws_region_final|d(aws_region)}}" disable_rollback: false - template: "{{ ANSIBLE_REPO_PATH }}/workdir/ec2_cloud_template.{{ env_type }}.{{ guid }}.json" + template: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/ec2_cloud_template.{{ env_type }}.{{ guid }}.json" tags: Stack: "project {{env_type}}-{{ guid }}" tags: [ destroying, destroy_cf_deployment ] diff --git a/ansible/configs/archive/ravello-bastion-setup/env_vars.yml b/tools/archive/configs/ravello-bastion-setup/env_vars.yml similarity index 97% rename from ansible/configs/archive/ravello-bastion-setup/env_vars.yml rename to tools/archive/configs/ravello-bastion-setup/env_vars.yml index 2cd8b36410c..aa01a5ad23d 100644 --- a/ansible/configs/archive/ravello-bastion-setup/env_vars.yml +++ b/tools/archive/configs/ravello-bastion-setup/env_vars.yml @@ -91,7 +91,7 @@ tower_run: false ipa_instance_type: "t2.large" -ansible_ssh_private_key_file: '{{ ANSIBLE_REPO_PATH }}/workdir/{{ env_authorized_key }}' +ansible_ssh_private_key_file: '{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{ env_authorized_key }}' #### VARIABLES YOU SHOULD ***NOT*** CONFIGURE FOR YOUR DEPLOYEMNT diff --git a/ansible/configs/archive/ravello-bastion-setup/files/cloud_providers/ec2_cloud_template.j2 b/tools/archive/configs/ravello-bastion-setup/files/cloud_providers/ec2_cloud_template.j2 similarity index 100% rename from ansible/configs/archive/ravello-bastion-setup/files/cloud_providers/ec2_cloud_template.j2 rename to tools/archive/configs/ravello-bastion-setup/files/cloud_providers/ec2_cloud_template.j2 diff --git a/ansible/configs/archive/ravello-bastion-setup/files/cloud_providers/ravello_cloud_template.j2 b/tools/archive/configs/ravello-bastion-setup/files/cloud_providers/ravello_cloud_template.j2 similarity index 100% rename from ansible/configs/archive/ravello-bastion-setup/files/cloud_providers/ravello_cloud_template.j2 rename to tools/archive/configs/ravello-bastion-setup/files/cloud_providers/ravello_cloud_template.j2 diff --git a/ansible/configs/archive/ravello-bastion-setup/files/cloud_providers/ravello_cloud_template.j2.short b/tools/archive/configs/ravello-bastion-setup/files/cloud_providers/ravello_cloud_template.j2.short similarity index 100% rename from ansible/configs/archive/ravello-bastion-setup/files/cloud_providers/ravello_cloud_template.j2.short rename to tools/archive/configs/ravello-bastion-setup/files/cloud_providers/ravello_cloud_template.j2.short diff --git a/ansible/configs/archive/ravello-bastion-setup/files/cloud_providers/ravello_cloud_template_2host.j2 b/tools/archive/configs/ravello-bastion-setup/files/cloud_providers/ravello_cloud_template_2host.j2 similarity index 100% rename from ansible/configs/archive/ravello-bastion-setup/files/cloud_providers/ravello_cloud_template_2host.j2 rename to tools/archive/configs/ravello-bastion-setup/files/cloud_providers/ravello_cloud_template_2host.j2 diff --git a/ansible/configs/archive/ravello-bastion-setup/files/ec2_internal_dns.json.j2 b/tools/archive/configs/ravello-bastion-setup/files/ec2_internal_dns.json.j2 similarity index 100% rename from ansible/configs/archive/ravello-bastion-setup/files/ec2_internal_dns.json.j2 rename to tools/archive/configs/ravello-bastion-setup/files/ec2_internal_dns.json.j2 diff --git a/ansible/configs/archive/ravello-bastion-setup/files/hosts_template.j2 b/tools/archive/configs/ravello-bastion-setup/files/hosts_template.j2 similarity index 100% rename from ansible/configs/archive/ravello-bastion-setup/files/hosts_template.j2 rename to tools/archive/configs/ravello-bastion-setup/files/hosts_template.j2 diff --git a/ansible/configs/archive/ravello-bastion-setup/files/opentlc-sample-config.sh.j2 b/tools/archive/configs/ravello-bastion-setup/files/opentlc-sample-config.sh.j2 similarity index 100% rename from ansible/configs/archive/ravello-bastion-setup/files/opentlc-sample-config.sh.j2 rename to tools/archive/configs/ravello-bastion-setup/files/opentlc-sample-config.sh.j2 diff --git a/ansible/configs/archive/ravello-bastion-setup/post_infra.yml b/tools/archive/configs/ravello-bastion-setup/post_infra.yml similarity index 100% rename from ansible/configs/archive/ravello-bastion-setup/post_infra.yml rename to tools/archive/configs/ravello-bastion-setup/post_infra.yml diff --git a/ansible/configs/archive/ravello-bastion-setup/post_software.yml b/tools/archive/configs/ravello-bastion-setup/post_software.yml similarity index 85% rename from ansible/configs/archive/ravello-bastion-setup/post_software.yml rename to tools/archive/configs/ravello-bastion-setup/post_software.yml index d8766f4c2ba..f97d7a5e166 100644 --- a/ansible/configs/archive/ravello-bastion-setup/post_software.yml +++ b/tools/archive/configs/ravello-bastion-setup/post_software.yml @@ -48,7 +48,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: generate ipa sample user script template: @@ -62,10 +62,10 @@ ########################## Save app as blueprint - name: Save app as blueprint - import_tasks: '{{ ANSIBLE_REPO_PATH }}/cloud_providers/{{ cloud_provider }}/save_environment.yml' + import_tasks: '{{ ANSIBLE_REPO_PATH | default('.') }}/cloud_providers/{{ cloud_provider }}/save_environment.yml' - name: Delete application - import_tasks: '{{ ANSIBLE_REPO_PATH }}/cloud_providers/{{ cloud_provider }}/delete_application.yml' + import_tasks: '{{ ANSIBLE_REPO_PATH | default('.') }}/cloud_providers/{{ cloud_provider }}/delete_application.yml' when: delete_app_post_deploy #- name: replace ssh config file diff --git a/ansible/configs/archive/ravello-bastion-setup/pre_infra.yml b/tools/archive/configs/ravello-bastion-setup/pre_infra.yml similarity index 81% rename from ansible/configs/archive/ravello-bastion-setup/pre_infra.yml rename to tools/archive/configs/ravello-bastion-setup/pre_infra.yml index 0541c524eed..9ac90b467b2 100644 --- a/ansible/configs/archive/ravello-bastion-setup/pre_infra.yml +++ b/tools/archive/configs/ravello-bastion-setup/pre_infra.yml @@ -13,7 +13,7 @@ msg: "Step 000 Pre Infrastructure - Dummy action" - name: Generate env ssh keys - import_tasks: "{{ ANSIBLE_REPO_PATH }}/cloud_providers/ravello/ssh_env_keygen.yml" + import_tasks: "{{ ANSIBLE_REPO_PATH | default('.') }}/cloud_providers/ravello/ssh_env_keygen.yml" - name: Resolve jmespath dependency hosts: localhost diff --git a/ansible/configs/archive/ravello-bastion-setup/pre_software.yml b/tools/archive/configs/ravello-bastion-setup/pre_software.yml similarity index 66% rename from ansible/configs/archive/ravello-bastion-setup/pre_software.yml rename to tools/archive/configs/ravello-bastion-setup/pre_software.yml index e0599e5df34..9fdcf665451 100644 --- a/ansible/configs/archive/ravello-bastion-setup/pre_software.yml +++ b/tools/archive/configs/ravello-bastion-setup/pre_software.yml @@ -35,11 +35,11 @@ remote_user: cloud-user become: true vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tasks: - copy: - src: "{{ ANSIBLE_REPO_PATH }}/workdir/{{env_authorized_key }}" + src: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{env_authorized_key }}" dest: /home/cloud-user/.ssh/id_rsa owner: cloud-user group: cloud-user @@ -47,8 +47,8 @@ - name: dump ansible_ssh_common_args hosts: localhost vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" tasks: - debug: var: ansible_ssh_common_args @@ -58,12 +58,12 @@ # - all # - localhost # vars_files: -# - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" -# - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_secret_vars.yml" +# - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" +# - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_secret_vars.yml" # tasks: # - name: dump all variables # template: -# src: "{{ ANSIBLE_REPO_PATH }}/vars_dump.j2" +# src: "{{ ANSIBLE_REPO_PATH | default('.') }}/vars_dump.j2" # dest: "/tmp/vars_dump" # force: yes # - fetch: diff --git a/ansible/configs/archive/ravello-bastion-setup/software.yml b/tools/archive/configs/ravello-bastion-setup/software.yml similarity index 100% rename from ansible/configs/archive/ravello-bastion-setup/software.yml rename to tools/archive/configs/ravello-bastion-setup/software.yml diff --git a/tools/archive/configs/ravello-bastion-setup/ssh_vars.yml b/tools/archive/configs/ravello-bastion-setup/ssh_vars.yml new file mode 100644 index 00000000000..e154442c025 --- /dev/null +++ b/tools/archive/configs/ravello-bastion-setup/ssh_vars.yml @@ -0,0 +1 @@ +ansible_ssh_common_args: -o ProxyCommand="ssh -i {{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{ env_authorized_key }} -W %h:%p -q cloud-user@{{ groups['bastion_host'].0 }}" diff --git a/ansible/configs/archive/ravello-test/How.To.Create.Env.Type.adoc b/tools/archive/configs/ravello-test/How.To.Create.Env.Type.adoc similarity index 100% rename from ansible/configs/archive/ravello-test/How.To.Create.Env.Type.adoc rename to tools/archive/configs/ravello-test/How.To.Create.Env.Type.adoc diff --git a/ansible/configs/archive/ravello-test/README.adoc b/tools/archive/configs/ravello-test/README.adoc similarity index 100% rename from ansible/configs/archive/ravello-test/README.adoc rename to tools/archive/configs/ravello-test/README.adoc diff --git a/ansible/configs/archive/ravello-test/destroy_env.yml b/tools/archive/configs/ravello-test/destroy_env.yml similarity index 87% rename from ansible/configs/archive/ravello-test/destroy_env.yml rename to tools/archive/configs/ravello-test/destroy_env.yml index 287319e787d..402a34fc7ba 100644 --- a/ansible/configs/archive/ravello-test/destroy_env.yml +++ b/tools/archive/configs/ravello-test/destroy_env.yml @@ -26,7 +26,7 @@ AWS_ACCESS_KEY_ID: "{{aws_access_key_id}}" AWS_SECRET_ACCESS_KEY: "{{aws_secret_access_key}}" AWS_DEFAULT_REGION: "{{aws_region_final|d(aws_region)}}" - shell: "aws route53 change-resource-record-sets --hosted-zone-id {{internal_zone_id}} --change-batch file://{{ ANSIBLE_REPO_PATH }}/workdir/internal_dns-{{ env_type }}-{{ guid }}_DELETE.json --region={{aws_region_final|d(aws_region)}}" + shell: "aws route53 change-resource-record-sets --hosted-zone-id {{internal_zone_id}} --change-batch file://{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/internal_dns-{{ env_type }}-{{ guid }}_DELETE.json --region={{aws_region_final|d(aws_region)}}" ignore_errors: true tags: - internal_dns_delete @@ -39,7 +39,7 @@ state: "absent" region: "{{aws_region_final|d(aws_region)}}" disable_rollback: false - template: "{{ ANSIBLE_REPO_PATH }}/workdir/ec2_cloud_template.{{ env_type }}.{{ guid }}.json" + template: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/ec2_cloud_template.{{ env_type }}.{{ guid }}.json" tags: Stack: "project {{env_type}}-{{ guid }}" tags: [ destroying, destroy_cf_deployment ] diff --git a/ansible/configs/archive/ravello-test/env_vars.yml b/tools/archive/configs/ravello-test/env_vars.yml similarity index 100% rename from ansible/configs/archive/ravello-test/env_vars.yml rename to tools/archive/configs/ravello-test/env_vars.yml diff --git a/ansible/configs/archive/ravello-test/files/cloud_providers/ec2_cloud_template.j2 b/tools/archive/configs/ravello-test/files/cloud_providers/ec2_cloud_template.j2 similarity index 100% rename from ansible/configs/archive/ravello-test/files/cloud_providers/ec2_cloud_template.j2 rename to tools/archive/configs/ravello-test/files/cloud_providers/ec2_cloud_template.j2 diff --git a/ansible/configs/archive/ravello-test/files/cloud_providers/ravello_cloud_template.j2 b/tools/archive/configs/ravello-test/files/cloud_providers/ravello_cloud_template.j2 similarity index 100% rename from ansible/configs/archive/ravello-test/files/cloud_providers/ravello_cloud_template.j2 rename to tools/archive/configs/ravello-test/files/cloud_providers/ravello_cloud_template.j2 diff --git a/ansible/configs/archive/ravello-test/files/cloud_providers/ravello_cloud_template.j2.short b/tools/archive/configs/ravello-test/files/cloud_providers/ravello_cloud_template.j2.short similarity index 100% rename from ansible/configs/archive/ravello-test/files/cloud_providers/ravello_cloud_template.j2.short rename to tools/archive/configs/ravello-test/files/cloud_providers/ravello_cloud_template.j2.short diff --git a/ansible/configs/archive/ravello-test/files/cloud_providers/ravello_cloud_template_2host.j2 b/tools/archive/configs/ravello-test/files/cloud_providers/ravello_cloud_template_2host.j2 similarity index 100% rename from ansible/configs/archive/ravello-test/files/cloud_providers/ravello_cloud_template_2host.j2 rename to tools/archive/configs/ravello-test/files/cloud_providers/ravello_cloud_template_2host.j2 diff --git a/ansible/configs/archive/ravello-test/files/ec2_internal_dns.json.j2 b/tools/archive/configs/ravello-test/files/ec2_internal_dns.json.j2 similarity index 100% rename from ansible/configs/archive/ravello-test/files/ec2_internal_dns.json.j2 rename to tools/archive/configs/ravello-test/files/ec2_internal_dns.json.j2 diff --git a/ansible/configs/archive/ravello-test/files/hosts_template.j2 b/tools/archive/configs/ravello-test/files/hosts_template.j2 similarity index 100% rename from ansible/configs/archive/ravello-test/files/hosts_template.j2 rename to tools/archive/configs/ravello-test/files/hosts_template.j2 diff --git a/ansible/configs/archive/ravello-test/files/opentlc-sample-config.sh.j2 b/tools/archive/configs/ravello-test/files/opentlc-sample-config.sh.j2 similarity index 100% rename from ansible/configs/archive/ravello-test/files/opentlc-sample-config.sh.j2 rename to tools/archive/configs/ravello-test/files/opentlc-sample-config.sh.j2 diff --git a/ansible/configs/archive/ravello-test/post_infra.yml b/tools/archive/configs/ravello-test/post_infra.yml similarity index 100% rename from ansible/configs/archive/ravello-test/post_infra.yml rename to tools/archive/configs/ravello-test/post_infra.yml diff --git a/ansible/configs/archive/ravello-test/post_software.yml b/tools/archive/configs/ravello-test/post_software.yml similarity index 82% rename from ansible/configs/archive/ravello-test/post_software.yml rename to tools/archive/configs/ravello-test/post_software.yml index b30d03bbb2b..b81e127f14b 100644 --- a/ansible/configs/archive/ravello-test/post_software.yml +++ b/tools/archive/configs/ravello-test/post_software.yml @@ -48,7 +48,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: generate ipa sample user script template: @@ -63,7 +63,7 @@ ########################## Save app as blueprint - name: Save app as blueprint - include: '{{ ANSIBLE_REPO_PATH }}/cloud_providers/{{ cloud_provider }}/save_environment.yml' + include: '{{ ANSIBLE_REPO_PATH | default('.') }}/cloud_providers/{{ cloud_provider }}/save_environment.yml' - name: Delete application - include: '{{ ANSIBLE_REPO_PATH }}/cloud_providers/{{ cloud_provider }}/delete_application.yml' + include: '{{ ANSIBLE_REPO_PATH | default('.') }}/cloud_providers/{{ cloud_provider }}/delete_application.yml' diff --git a/ansible/configs/archive/ravello-test/pre_infra.yml b/tools/archive/configs/ravello-test/pre_infra.yml similarity index 100% rename from ansible/configs/archive/ravello-test/pre_infra.yml rename to tools/archive/configs/ravello-test/pre_infra.yml diff --git a/ansible/configs/archive/ravello-test/pre_software.yml b/tools/archive/configs/ravello-test/pre_software.yml similarity index 100% rename from ansible/configs/archive/ravello-test/pre_software.yml rename to tools/archive/configs/ravello-test/pre_software.yml diff --git a/ansible/configs/archive/ravello-test/ssh_vars.yml b/tools/archive/configs/ravello-test/ssh_vars.yml similarity index 100% rename from ansible/configs/archive/ravello-test/ssh_vars.yml rename to tools/archive/configs/ravello-test/ssh_vars.yml diff --git a/ansible/configs/archive/single-ipa/How.To.Create.Env.Type.adoc b/tools/archive/configs/single-ipa/How.To.Create.Env.Type.adoc similarity index 100% rename from ansible/configs/archive/single-ipa/How.To.Create.Env.Type.adoc rename to tools/archive/configs/single-ipa/How.To.Create.Env.Type.adoc diff --git a/ansible/configs/archive/single-ipa/README.adoc b/tools/archive/configs/single-ipa/README.adoc similarity index 96% rename from ansible/configs/archive/single-ipa/README.adoc rename to tools/archive/configs/single-ipa/README.adoc index 81678a6fbe1..564630e6f48 100644 --- a/ansible/configs/archive/single-ipa/README.adoc +++ b/tools/archive/configs/single-ipa/README.adoc @@ -63,7 +63,7 @@ HOSTZONEID='Z3IHLWJZOU9SRT' time ansible-playbook ./main.yml \ -e "guid=${GUID}" -e "env_type=${ENVTYPE}" -e "cloud_provider=${CLOUDPROVIDER}" -e "aws_region=${REGION}" \ -e "HostedZoneId=${HOSTZONEID}" -e "key_name=${KEYNAME}" -e "subdomain_base_suffix=.example.opentlc.com" \ --e "software_to_deploy=none" -e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" +-e "software_to_deploy=none" -e "ANSIBLE_REPO_PATH | default('.')=${DEPLOYER_REPO_PATH}" diff --git a/ansible/configs/archive/single-ipa/destroy_env.yml b/tools/archive/configs/single-ipa/destroy_env.yml similarity index 89% rename from ansible/configs/archive/single-ipa/destroy_env.yml rename to tools/archive/configs/single-ipa/destroy_env.yml index 2ea51342df5..660cf22f179 100644 --- a/ansible/configs/archive/single-ipa/destroy_env.yml +++ b/tools/archive/configs/single-ipa/destroy_env.yml @@ -26,7 +26,7 @@ AWS_ACCESS_KEY_ID: "{{aws_access_key_id}}" AWS_SECRET_ACCESS_KEY: "{{aws_secret_access_key}}" AWS_DEFAULT_REGION: "{{aws_region_final|d(aws_region)}}" - shell: "aws route53 change-resource-record-sets --hosted-zone-id {{internal_zone_id}} --change-batch file://{{ ANSIBLE_REPO_PATH }}/workdir/internal_dns-{{ env_type }}-{{ guid }}_DELETE.json --region={{aws_region_final|d(aws_region)}}" + shell: "aws route53 change-resource-record-sets --hosted-zone-id {{internal_zone_id}} --change-batch file://{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/internal_dns-{{ env_type }}-{{ guid }}_DELETE.json --region={{aws_region_final|d(aws_region)}}" ignore_errors: true tags: - internal_dns_delete @@ -39,7 +39,7 @@ state: "absent" region: "{{aws_region_final|d(aws_region)}}" disable_rollback: false - template: "{{ ANSIBLE_REPO_PATH }}/workdir/ec2_cloud_template.{{ env_type }}.{{ guid }}.json" + template: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/ec2_cloud_template.{{ env_type }}.{{ guid }}.json" tags: Stack: "project {{env_type}}-{{ guid }}" tags: [ destroying, destroy_cf_deployment ] diff --git a/ansible/configs/archive/single-ipa/env_vars.yml b/tools/archive/configs/single-ipa/env_vars.yml similarity index 97% rename from ansible/configs/archive/single-ipa/env_vars.yml rename to tools/archive/configs/single-ipa/env_vars.yml index 461dc989d84..05617e5c938 100644 --- a/ansible/configs/archive/single-ipa/env_vars.yml +++ b/tools/archive/configs/single-ipa/env_vars.yml @@ -6,7 +6,7 @@ ### For now, just tagging comments in line with configuration file. -deploy_local_ssh_config_location: "{{ ANSIBLE_REPO_PATH }}/workdir" +deploy_local_ssh_config_location: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir" ################################################################################ #### GENERIC EXAMPLE diff --git a/ansible/configs/archive/single-ipa/files/cloud_providers/ec2_cloud_template.j2 b/tools/archive/configs/single-ipa/files/cloud_providers/ec2_cloud_template.j2 similarity index 100% rename from ansible/configs/archive/single-ipa/files/cloud_providers/ec2_cloud_template.j2 rename to tools/archive/configs/single-ipa/files/cloud_providers/ec2_cloud_template.j2 diff --git a/ansible/configs/archive/single-ipa/files/ec2_internal_dns.json.j2 b/tools/archive/configs/single-ipa/files/ec2_internal_dns.json.j2 similarity index 100% rename from ansible/configs/archive/single-ipa/files/ec2_internal_dns.json.j2 rename to tools/archive/configs/single-ipa/files/ec2_internal_dns.json.j2 diff --git a/ansible/configs/archive/single-ipa/files/hosts_template.j2 b/tools/archive/configs/single-ipa/files/hosts_template.j2 similarity index 100% rename from ansible/configs/archive/single-ipa/files/hosts_template.j2 rename to tools/archive/configs/single-ipa/files/hosts_template.j2 diff --git a/ansible/configs/archive/single-ipa/files/opentlc-sample-config.sh.j2 b/tools/archive/configs/single-ipa/files/opentlc-sample-config.sh.j2 similarity index 100% rename from ansible/configs/archive/single-ipa/files/opentlc-sample-config.sh.j2 rename to tools/archive/configs/single-ipa/files/opentlc-sample-config.sh.j2 diff --git a/ansible/configs/archive/single-ipa/post_infra.yml b/tools/archive/configs/single-ipa/post_infra.yml similarity index 100% rename from ansible/configs/archive/single-ipa/post_infra.yml rename to tools/archive/configs/single-ipa/post_infra.yml diff --git a/ansible/configs/archive/single-ipa/post_software.yml b/tools/archive/configs/single-ipa/post_software.yml similarity index 94% rename from ansible/configs/archive/single-ipa/post_software.yml rename to tools/archive/configs/single-ipa/post_software.yml index 9586ba160f0..e9d70587b20 100644 --- a/ansible/configs/archive/single-ipa/post_software.yml +++ b/tools/archive/configs/single-ipa/post_software.yml @@ -48,7 +48,7 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" tasks: - name: generate ipa sample user script template: diff --git a/ansible/configs/archive/single-ipa/pre_infra.yml b/tools/archive/configs/single-ipa/pre_infra.yml similarity index 100% rename from ansible/configs/archive/single-ipa/pre_infra.yml rename to tools/archive/configs/single-ipa/pre_infra.yml diff --git a/ansible/configs/archive/single-ipa/pre_software.yml b/tools/archive/configs/single-ipa/pre_software.yml similarity index 80% rename from ansible/configs/archive/single-ipa/pre_software.yml rename to tools/archive/configs/single-ipa/pre_software.yml index 4b316841b62..c830269fa59 100644 --- a/ansible/configs/archive/single-ipa/pre_software.yml +++ b/tools/archive/configs/single-ipa/pre_software.yml @@ -18,7 +18,7 @@ - name: create file for internal dns names template: src: "./files/{{cloud_provider}}_internal_dns.json.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/internal_dns-{{ env_type }}-{{ guid }}.json" + dest: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/internal_dns-{{ env_type }}-{{ guid }}.json" tags: - internal_dns_creation @@ -29,7 +29,7 @@ - name: create Delete file for internal dns names template: src: "./files/{{cloud_provider}}_internal_dns.json.j2" - dest: "{{ ANSIBLE_REPO_PATH }}/workdir/internal_dns-{{ env_type }}-{{ guid }}_DELETE.json" + dest: "{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/internal_dns-{{ env_type }}-{{ guid }}_DELETE.json" tags: - internal_dns_creation @@ -54,7 +54,7 @@ AWS_ACCESS_KEY_ID: "{{aws_access_key_id}}" AWS_SECRET_ACCESS_KEY: "{{aws_secret_access_key}}" AWS_DEFAULT_REGION: "{{aws_region_final|d(aws_region)}}" - shell: "aws route53 change-resource-record-sets --hosted-zone-id {{internal_zone_id}} --change-batch file://{{ ANSIBLE_REPO_PATH }}/workdir/internal_dns-{{ env_type }}-{{ guid }}.json --region={{aws_region_final|d(aws_region)}}" + shell: "aws route53 change-resource-record-sets --hosted-zone-id {{internal_zone_id}} --change-batch file://{{ ANSIBLE_REPO_PATH | default('.') }}/workdir/internal_dns-{{ env_type }}-{{ guid }}.json --region={{aws_region_final|d(aws_region)}}" ignore_errors: true tags: - internal_dns_creation @@ -66,10 +66,10 @@ gather_facts: False become: yes vars_files: - - "{{ ANSIBLE_REPO_PATH }}/configs/{{ env_type }}/env_vars.yml" + - "{{ ANSIBLE_REPO_PATH | default('.') }}/configs/{{ env_type }}/env_vars.yml" run_once: true roles: - - { role: "{{ ANSIBLE_REPO_PATH }}/roles/ipa-server", configure_firewalld: "false" } + - { role: "ipa-server", configure_firewalld: "false" } tags: - ipa_server_tasks - install_ipa diff --git a/tools/archive/configs/single-ipa/ssh_vars.yml b/tools/archive/configs/single-ipa/ssh_vars.yml new file mode 100644 index 00000000000..25d2a2fb14c --- /dev/null +++ b/tools/archive/configs/single-ipa/ssh_vars.yml @@ -0,0 +1 @@ +ansible_ssh_extra_args: "-F {{ ANSIBLE_REPO_PATH | default('.') }}/workdir/{{ env_type }}_{{ guid }}_ssh_conf -o StrictHostKeyChecking=no"