Shachar Borenstein
2017-04-19 c96e2076d5f6c0af4472afb9ae581d8835821f52
Merge pull request #26 from sborenst/ocp_workshop_3.5_testing

Ocp workshop 3.5 testing
16 files deleted
10 files modified
6214 ■■■■■ changed files
ansible/configs/ansible-provisioner/README.adoc 4 ●●●● patch | view | raw | blame | history
ansible/configs/ansible-provisioner/env_vars.yml 6 ●●●● patch | view | raw | blame | history
ansible/configs/ansible-provisioner/files/Sync_Repositories.sh 64 ●●●●● patch | view | raw | blame | history
ansible/configs/ansible-provisioner/files/cloud_providers/ec2_cloud_template.j2 202 ●●●●● patch | view | raw | blame | history
ansible/configs/ansible-provisioner/post_software.yml 31 ●●●● patch | view | raw | blame | history
ansible/configs/generic-example/003_pre_software001.tasks.yml 36 ●●●●● patch | view | raw | blame | history
ansible/configs/generic-example/README.adoc 67 ●●●●● patch | view | raw | blame | history
ansible/configs/generic-example/destroy_env.yml 37 ●●●●● patch | view | raw | blame | history
ansible/configs/generic-example/env_vars.yml 152 ●●●●● patch | view | raw | blame | history
ansible/configs/generic-example/files/cloud_providers/ec2_cloud_template.j2 447 ●●●●● patch | view | raw | blame | history
ansible/configs/generic-example/files/ec2_internal_dns.json.j2 39 ●●●●● patch | view | raw | blame | history
ansible/configs/generic-example/files/hosts_template.j2 24 ●●●●● patch | view | raw | blame | history
ansible/configs/generic-example/post_software.yml 13 ●●●●● patch | view | raw | blame | history
ansible/configs/generic-example/ssh_vars.yml 5 ●●●●● patch | view | raw | blame | history
ansible/configs/ocp-ha-lab/files/cloud_providers/CloudForms_CloudFormation_Template.json 787 ●●●●● patch | view | raw | blame | history
ansible/configs/ocp-ha-lab/files/cloud_providers/ec2_cloud_template.j2 3 ●●●● patch | view | raw | blame | history
ansible/configs/ocp-ha-lab/files/cloud_providers/ec2_cloud_template_with_s3.j2 774 ●●●●● patch | view | raw | blame | history
ansible/configs/ocp-implementation-lab/files/cloud_providers/CloudForms_CloudFormation_Template.json 787 ●●●●● patch | view | raw | blame | history
ansible/configs/ocp-implementation-lab/files/cloud_providers/ec2_cloud_template.j2 3 ●●●● patch | view | raw | blame | history
ansible/configs/ocp-implementation-lab/files/cloud_providers/ec2_cloud_template_with_s3.j2 774 ●●●●● patch | view | raw | blame | history
ansible/configs/ocp-workshop/files/cloud_providers/ec2_cloud_template.j2 3 ●●●● patch | view | raw | blame | history
ansible/configs/ocp-workshop/files/cloud_providers/ec2_cloud_template_old.j2 660 ●●●●● patch | view | raw | blame | history
ansible/configs/ocp-workshop/files/env_infra_template.j2 3 ●●●● patch | view | raw | blame | history
ansible/configs/opentlc-shared/files/cloud_providers/ec2_cloud_template_old.j2 660 ●●●●● patch | view | raw | blame | history
ansible/configs/opentlc-shared/files/env_infra_template.j2 630 ●●●●● patch | view | raw | blame | history
ansible/configs/single-ipa/files/cloud_providers/ec2_cloud_template.j2 3 ●●●● patch | view | raw | blame | history
ansible/configs/ansible-provisioner/README.adoc
@@ -53,9 +53,9 @@
----
## For a HA environment
REGION=us-west-2
REGION=ap-southeast-1
KEYNAME=ansible_provisioner
GUID=shared
GUID=apac
ENVTYPE="ansible-provisioner"
CLOUDPROVIDER=ec2
HOSTZONEID='Z3IHLWJZOU9SRT'
ansible/configs/ansible-provisioner/env_vars.yml
@@ -39,6 +39,10 @@
  - vim-enhanced
  - ansible
  - python-boto
  - lvm2
  - httpd
  - yum-utils
  - createrepo
rhel_repos:
  - rhel-7-server-rpms
@@ -103,4 +107,4 @@
storage_vg: storagevg
storage_pvs: /dev/xvdb
storage_mount_path: /var/www/html
storage_mount_path: /srv
ansible/configs/ansible-provisioner/files/Sync_Repositories.sh
@@ -7,40 +7,33 @@
#From you workstation host, run the following command to download/sync the repos down to the REPOSYNC_HOST
# Your workstation needs to be able to authenticate to both the REPOSYNC_HOST and the TARGET_HOST
# for
export REPOVERSION="$1"
export REPOMINORVERSION="$2"
# for version 3.4 of ocp
#export REPOMINORVERSION="3.4.1.12"
#export REPOVERSION="3.4"
# # # for version 3.5 of ocp
# export REPOVERSION="3.5"
# export REPOMINORVERSION="3.5.5.5"
#
export REPOLIST="rhel-7-fast-datapath-rpms rhel-7-server-extras-rpms rhel-7-server-optional-rpms rhel-7-server-ose-${REPOVERSION}-rpms rhel-7-server-rpms rhel-7-server-rh-common-rpms"
#export REPOLIST="rhel-7-server-ose-${REPOVERSION}-rpms"
export CLASS="ocp"
export REPODIR="/var/www/html/repos/"
export REPOPATH="${REPODIR}/${CLASS}/${REPOMINORVERSION}"
export REPOBASE="/srv/repos/"
export REPOPATH="${REPOBASE}/${CLASS}/${REPOMINORVERSION}"
echo "REPOLIST is: $REPOLIST"
echo "REPOVERSION is: ${REPOVERSION}"
echo "CLASS is: $CLASS"
 #
 #
 # subscription-manager register --username=${RHNID} --password=${RHNPASS}
 # subscription-manager list --available
 # subscription-manager attach --pool=${RHNPOOL}
 # subscription-manager repos --disable="*"
 # subscription-manager repos \
 #    --enable="rhel-7-server-rpms" \
 #    --enable="rhel-7-server-extras-rpms" \
 #    --enable="rhel-7-server-ose-${REPOVERSION}-rpms" \
 #    --enable="rhel-7-server-optional-rpms" \
 #    --enable="rhel-7-server-rh-common-rpms" \
 #    --enable="rhel-7-fast-datapath-rpms"
 # yum install -y yum-utils createrepo tmux
 # yum clean all ; yum repolist
 # cd $REPOBASE
 # rm -rf $REPOBASE
 # mkdir -p $REPOBASE
 # cd $REPOBASE
mkdir -p ${REPOPATH}
cd ${REPOPATH}
for repo_name in ${REPOLIST} ;
time for repo_name in ${REPOLIST} ;
  do
    echo "Processing repo: ${repo_name}"
    echo "reposync -r ${repo_name}  -n -m -p ."
@@ -48,8 +41,29 @@
    cd ${repo_name}
    sudo createrepo .
    cd ..
    #sudo tar -zcvf ${repo_name}.tar.gz ${repo_name}
    echo "Completed processing of: ${repo_name}"
  done
ln -s ${REPOPATH} ${REPODIR}/${CLASS}/${REPOVERSION}
ln -s ${REPOBASE}/${CLASS}/${REPOMINORVERSION} ${REPOBASE}/${CLASS}/${REPOVERSION}
  #
  #
  # subscription-manager register --username=${RHNID} --password=${RHNPASS}
  # subscription-manager list --available
  # subscription-manager attach --pool=${RHNPOOL}
  # subscription-manager repos --disable="*"
  # subscription-manager repos \
  #    --enable="rhel-7-server-rpms" \
  #    --enable="rhel-7-server-extras-rpms" \
  #    --enable="rhel-7-server-ose-${REPOVERSION}-rpms" \
  #    --enable="rhel-7-server-optional-rpms" \
  #    --enable="rhel-7-server-rh-common-rpms" \
  #    --enable="rhel-7-fast-datapath-rpms"
  # yum install -y yum-utils createrepo tmux
  # yum clean all ; yum repolist
  # cd $REPOBASE
  # rm -rf $REPOBASE
  # mkdir -p $REPOBASE
  # cd $REPOBASE
ansible/configs/ansible-provisioner/files/cloud_providers/ec2_cloud_template.j2
@@ -121,7 +121,205 @@
      }
    },
    "VPCRouteInternetGateway": {
      "Type": "AWS::EC2::Route",
      "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "DependsOn" : "VpcGA",
  "Type": "AWS::EC2::Route",
      "Properties": {
        "GatewayId": {
          "Ref": "VpcInternetGateway"
@@ -300,7 +498,7 @@
            "DeviceName": "/dev/xvdb",
            "Ebs": {
              "VolumeType": "gp2",
              "VolumeSize": 20
              "VolumeSize": 300
            }
          }
        ]
ansible/configs/ansible-provisioner/post_software.yml
@@ -37,7 +37,10 @@
    - file: "path=/opt/OPEN_Admin/ state=directory owner=opentlc-mgr recurse=yes group=opentlc-mgr  mode=0770"
    - file: "path=/opt/ansible_agnostic_deployer/ state=directory owner=opentlc-mgr recurse=yes group=opentlc-mgr  mode=0770"
    - name: Copy ssh key to provisioner
      copy:
        src: ~/.ssh/{key_name}.pem
        dest: /home/opentlc-mgr/.ssh/{key_name}.pem
    - name: Allow Access to opentlc-mgr user
      shell: |
          mkdir /home/opentlc-mgr/bin;
@@ -60,11 +63,13 @@
          mkdir /home/opentlc-mgr/.aws
          echo '
          [default]
          aws_access_key_id = "{{aws_access_key_id}}"
          aws_secret_access_key = "{{aws_secret_access_key}}"' > /home/opentlc-mgr/.aws/credentials
          aws_access_key_id = {{aws_access_key_id}}
          aws_secret_access_key = {{aws_secret_access_key}}' > /home/opentlc-mgr/.aws/credentials
          chown -R opentlc-mgr.opentlc-mgr /home/opentlc-mgr/.aws
    - name: Copy boto.cfg file to /etc
      shell: "cp /opt/ansible_agnostic_deployer/ansible/inventory/boto.cfg /etc/boto.cfg"
    - name: Copy boto.cfg file to /etc
    - name: Copy Sync_Repositories.sh file to /root
      shell: "cp /opt/ansible_agnostic_deployer/ansible/configs/ansible-provisioner/files/Sync_Repositories.sh /root"
    - lvg:
        vg: "{{ storage_vg }}"
@@ -80,21 +85,29 @@
    - filesystem:
        fstype: ext4
        dev: "/dev/{{ storage_vg }}/storagelv"
      ignore_errors: true
    - file:
        path: "{{ storage_mount_path }}"
        state: directory
        mode: 0755
        mode: 0777
    - selinux:
        policy: targeted
        state: permissive
    - lineinfile:
        dest: /etc/fstab
        insertafter: EOF
        line: "/dev/{{ storage_vg }}/nfsmount {{ storage_mount_path}} ext4 defaults 0 0"
        line: "/dev/{{ storage_vg }}/storagelv {{ storage_mount_path}} ext4 defaults 0 0"
        state: present
      ignore_errors: true
    - shell: "mount {{ storage_mount_path }} || echo already mounted"
    - shell: "systemctl enable httpd && systemctl restart httpd"
    - shell: "mkdir {{ storage_mount_path }} &&  mount {{ storage_mount_path }}"
#    - shell: "SELINUX=enforcing"
    - shell: "systemctl enable http && systemctl restart httpd"
    - shell: "ln -s {{storage_mount_path}}/repos /var/www/html/repos"
#    - shell: "chcon -R -t httpd_user_content_t /srv"
#    - shell: "chcon -R -t httpd_user_content_t /var/www/html/repos"
### Still need to add "env_secret_vars" files to actually get this to work
### still need to run the repository sync script.
ansible/configs/generic-example/003_pre_software001.tasks.yml
File was deleted
ansible/configs/generic-example/README.adoc
File was deleted
ansible/configs/generic-example/destroy_env.yml
File was deleted
ansible/configs/generic-example/env_vars.yml
File was deleted
ansible/configs/generic-example/files/cloud_providers/ec2_cloud_template.j2
File was deleted
ansible/configs/generic-example/files/ec2_internal_dns.json.j2
File was deleted
ansible/configs/generic-example/files/hosts_template.j2
File was deleted
ansible/configs/generic-example/post_software.yml
File was deleted
ansible/configs/generic-example/ssh_vars.yml
File was deleted
ansible/configs/ocp-ha-lab/files/cloud_providers/CloudForms_CloudFormation_Template.json
File was deleted
ansible/configs/ocp-ha-lab/files/cloud_providers/ec2_cloud_template.j2
@@ -121,7 +121,8 @@
      }
    },
    "VPCRouteInternetGateway": {
      "Type": "AWS::EC2::Route",
      "DependsOn" : "VpcGA",
  "Type": "AWS::EC2::Route",
      "Properties": {
        "GatewayId": {
          "Ref": "VpcInternetGateway"
ansible/configs/ocp-ha-lab/files/cloud_providers/ec2_cloud_template_with_s3.j2
File was deleted
ansible/configs/ocp-implementation-lab/files/cloud_providers/CloudForms_CloudFormation_Template.json
File was deleted
ansible/configs/ocp-implementation-lab/files/cloud_providers/ec2_cloud_template.j2
@@ -121,7 +121,8 @@
      }
    },
    "VPCRouteInternetGateway": {
      "Type": "AWS::EC2::Route",
      "DependsOn" : "VpcGA",
  "Type": "AWS::EC2::Route",
      "Properties": {
        "GatewayId": {
          "Ref": "VpcInternetGateway"
ansible/configs/ocp-implementation-lab/files/cloud_providers/ec2_cloud_template_with_s3.j2
File was deleted
ansible/configs/ocp-workshop/files/cloud_providers/ec2_cloud_template.j2
@@ -121,7 +121,8 @@
      }
    },
    "VPCRouteInternetGateway": {
      "Type": "AWS::EC2::Route",
      "DependsOn" : "VpcGA",
  "Type": "AWS::EC2::Route",
      "Properties": {
        "GatewayId": {
          "Ref": "VpcInternetGateway"
ansible/configs/ocp-workshop/files/cloud_providers/ec2_cloud_template_old.j2
File was deleted
ansible/configs/ocp-workshop/files/env_infra_template.j2
@@ -115,7 +115,8 @@
      }
    },
    "VPCRouteInternetGateway": {
      "Type": "AWS::EC2::Route",
      "DependsOn" : "VpcGA",
  "Type": "AWS::EC2::Route",
      "Properties": {
        "GatewayId": {
          "Ref": "VpcInternetGateway"
ansible/configs/opentlc-shared/files/cloud_providers/ec2_cloud_template_old.j2
File was deleted
ansible/configs/opentlc-shared/files/env_infra_template.j2
File was deleted
ansible/configs/single-ipa/files/cloud_providers/ec2_cloud_template.j2
@@ -115,7 +115,8 @@
      }
    },
    "VPCRouteInternetGateway": {
      "Type": "AWS::EC2::Route",
      "DependsOn" : "VpcGA",
  "Type": "AWS::EC2::Route",
      "Properties": {
        "GatewayId": {
          "Ref": "VpcInternetGateway"