From 65e50b4dd338a4757a2bfb883d34d803350c3aae Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Mon, 2 Feb 2015 10:40:48 -0700 Subject: Use more descriptive name in Development Project --- lib/aws_command.rb | 2 +- lib/gce_command.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/aws_command.rb b/lib/aws_command.rb index 1c3efc91c..5979b8eb6 100644 --- a/lib/aws_command.rb +++ b/lib/aws_command.rb @@ -7,7 +7,7 @@ module OpenShift module Ops class AwsCommand < Thor # WARNING: we do not currently support environments with hyphens in the name - SUPPORTED_ENVS = %w(prod stg int tint kint test jint amint tdint lint) + SUPPORTED_ENVS = %w(prod stg int tint kint test jhonce amint tdint lint) option :type, :required => true, :enum => LaunchHelper.get_aws_host_types, :desc => 'The host type of the new instances.' diff --git a/lib/gce_command.rb b/lib/gce_command.rb index 54dbf29ba..b0a84d27b 100644 --- a/lib/gce_command.rb +++ b/lib/gce_command.rb @@ -10,7 +10,7 @@ module OpenShift module Ops class GceCommand < Thor # WARNING: we do not currently support environments with hyphens in the name - SUPPORTED_ENVS = %w(prod stg int tint kint test jint amint tdint lint) + SUPPORTED_ENVS = %w(prod stg int tint kint test jhonce amint tdint lint) option :type, :required => true, :enum => LaunchHelper.get_gce_host_types, :desc => 'The host type of the new instances.' -- cgit v1.2.3 From 7d74d1913274cba4c4732cbc5f0a573cb99e5248 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Thu, 12 Feb 2015 11:26:56 -0700 Subject: - Rename minion to node - Update playbooks to support latest code --- README_GCE.md | 2 +- cluster.sh | 24 ++--- playbooks/aws/openshift-master/config.yml | 14 +-- playbooks/aws/openshift-minion/config.yml | 40 -------- playbooks/aws/openshift-minion/launch.yml | 69 ------------- playbooks/aws/openshift-minion/vars.yml | 0 playbooks/aws/openshift-node/config.yml | 40 ++++++++ playbooks/aws/openshift-node/launch.yml | 69 +++++++++++++ playbooks/aws/openshift-node/vars.yml | 0 playbooks/gce/openshift-master/config.yml | 17 ++-- playbooks/gce/openshift-minion/config.yml | 40 -------- playbooks/gce/openshift-minion/launch.yml | 47 --------- playbooks/gce/openshift-minion/terminate.yml | 41 -------- playbooks/gce/openshift-minion/vars.yml | 0 playbooks/gce/openshift-node/config.yml | 55 +++++++++++ playbooks/gce/openshift-node/launch.yml | 47 +++++++++ playbooks/gce/openshift-node/terminate.yml | 41 ++++++++ playbooks/gce/openshift-node/vars.yml | 0 roles/docker/tasks/main.yml | 2 +- roles/kubernetes_apiserver/tasks/main.yml | 2 +- roles/openshift_master/handlers/main.yml | 2 +- roles/openshift_master/tasks/main.yml | 11 +-- roles/openshift_minion/README.md | 38 -------- roles/openshift_minion/defaults/main.yml | 2 - roles/openshift_minion/handlers/main.yml | 4 - roles/openshift_minion/meta/main.yml | 124 ------------------------ roles/openshift_minion/tasks/main.yml | 29 ------ roles/openshift_minion/vars/main.yml | 2 - roles/openshift_node/README.md | 38 ++++++++ roles/openshift_node/defaults/main.yml | 2 + roles/openshift_node/files/sysconfig/kubeconfig | 40 ++++++++ roles/openshift_node/handlers/main.yml | 4 + roles/openshift_node/meta/main.yml | 124 ++++++++++++++++++++++++ roles/openshift_node/tasks/main.yml | 38 ++++++++ roles/openshift_node/vars/main.yml | 2 + roles/repos/files/epel7-openshift.repo | 6 ++ roles/repos/files/epel7-origin.repo | 6 -- roles/repos/files/oso-rhui-rhel-7-server.repo | 48 +++++++-- roles/repos/tasks/main.yaml | 5 +- 39 files changed, 587 insertions(+), 488 deletions(-) delete mode 100644 playbooks/aws/openshift-minion/config.yml delete mode 100644 playbooks/aws/openshift-minion/launch.yml delete mode 100644 playbooks/aws/openshift-minion/vars.yml create mode 100644 playbooks/aws/openshift-node/config.yml create mode 100644 playbooks/aws/openshift-node/launch.yml create mode 100644 playbooks/aws/openshift-node/vars.yml delete mode 100644 playbooks/gce/openshift-minion/config.yml delete mode 100644 playbooks/gce/openshift-minion/launch.yml delete mode 100644 playbooks/gce/openshift-minion/terminate.yml delete mode 100644 playbooks/gce/openshift-minion/vars.yml create mode 100644 playbooks/gce/openshift-node/config.yml create mode 100644 playbooks/gce/openshift-node/launch.yml create mode 100644 playbooks/gce/openshift-node/terminate.yml create mode 100644 playbooks/gce/openshift-node/vars.yml delete mode 100644 roles/openshift_minion/README.md delete mode 100644 roles/openshift_minion/defaults/main.yml delete mode 100644 roles/openshift_minion/handlers/main.yml delete mode 100644 roles/openshift_minion/meta/main.yml delete mode 100644 roles/openshift_minion/tasks/main.yml delete mode 100644 roles/openshift_minion/vars/main.yml create mode 100644 roles/openshift_node/README.md create mode 100644 roles/openshift_node/defaults/main.yml create mode 100644 roles/openshift_node/files/sysconfig/kubeconfig create mode 100644 roles/openshift_node/handlers/main.yml create mode 100644 roles/openshift_node/meta/main.yml create mode 100644 roles/openshift_node/tasks/main.yml create mode 100644 roles/openshift_node/vars/main.yml create mode 100644 roles/repos/files/epel7-openshift.repo delete mode 100644 roles/repos/files/epel7-origin.repo diff --git a/README_GCE.md b/README_GCE.md index 2c738e56e..af758af21 100644 --- a/README_GCE.md +++ b/README_GCE.md @@ -72,5 +72,5 @@ Test The Setup 3. Try to create an instance: ``` - ./cloud.rb gce launch -n ${USER}-minion1 -e int --type os3-minion + ./cloud.rb gce launch -n ${USER}-node1 -e int --type os3-node ``` diff --git a/cluster.sh b/cluster.sh index 97b957a57..9c9aad4d2 100755 --- a/cluster.sh +++ b/cluster.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu -MINIONS=2 +NODES=2 MASTERS=1 # If the environment variable OO_PROVDER is defined, it used for the provider @@ -13,10 +13,10 @@ fi UPPER_CASE_PROVIDER=$(echo $PROVIDER | tr '[:lower:]' '[:upper:]') -# Use OO_MASTER_PLAYBOOK/OO_MINION_PLAYBOOK environment variables for playbooks if defined, +# Use OO_MASTER_PLAYBOOK/OO_NODE_PLAYBOOK environment variables for playbooks if defined, # otherwise use openshift default values. MASTER_PLAYBOOK=${OO_MASTER_PLAYBOOK:-'openshift-master'} -MINION_PLAYBOOK=${OO_MINION_PLAYBOOK:-'openshift-minion'} +NODE_PLAYBOOK=${OO_NODE_PLAYBOOK:-'openshift-node'} # @formatter:off @@ -29,10 +29,10 @@ function usage { $([ $? -ne 0 ] && echo "No supported environment tags found for ${PROVIDER}") Optional arguments for create: - [-p|--provider, -m|--masters, -n|--minions, --master-playbook, --minion-playbook] + [-p|--provider, -m|--masters, -n|--nodes, --master-playbook, --node-playbook] Optional arguments for terminate|update: - [-p|--provider, --master-playbook, --minion-playbook] + [-p|--provider, --master-playbook, --node-playbook] EOT } # @formatter:on @@ -40,21 +40,21 @@ EOT function create_cluster { ./cloud.rb "${PROVIDER}" launch -e "${ENV}" --type=$MASTER_PLAYBOOK -c $MASTERS - ./cloud.rb "${PROVIDER}" launch -e "${ENV}" --type=$MINION_PLAYBOOK -c $MINIONS + ./cloud.rb "${PROVIDER}" launch -e "${ENV}" --type=$NODE_PLAYBOOK -c $NODES update_cluster - echo -e "\nCreated ${MASTERS}/${MASTER_PLAYBOOK} masters and ${MINIONS}/${MINION_PLAYBOOK} minions using ${PROVIDER} provider\n" + echo -e "\nCreated ${MASTERS}/${MASTER_PLAYBOOK} masters and ${NODES}/${NODE_PLAYBOOK} nodes using ${PROVIDER} provider\n" } function update_cluster { ./cloud.rb "${PROVIDER}" config -e "${ENV}" --type=$MASTER_PLAYBOOK - ./cloud.rb "${PROVIDER}" config -e "${ENV}" --type=$MINION_PLAYBOOK + ./cloud.rb "${PROVIDER}" config -e "${ENV}" --type=$NODE_PLAYBOOK } function terminate_cluster { ./cloud.rb "${PROVIDER}" terminate -e "${ENV}" --type=$MASTER_PLAYBOOK - ./cloud.rb "${PROVIDER}" terminate -e "${ENV}" --type=$MINION_PLAYBOOK + ./cloud.rb "${PROVIDER}" terminate -e "${ENV}" --type=$NODE_PLAYBOOK } [ -f ./cloud.rb ] || (echo 1>&2 'Cannot find ./cloud.rb' && exit 1) @@ -68,7 +68,7 @@ function check_argval { } # Using GNU getopt to support both small and long formats -OPTIONS=`getopt -o p:m:n:h --long provider:,masters:,minions:,master-playbook:,minion-playbook:,help \ +OPTIONS=`getopt -o p:m:n:h --long provider:,masters:,nodes:,master-playbook:,node-playbook:,help \ -n "$0" -- "$@"` eval set -- "$OPTIONS" @@ -77,9 +77,9 @@ while true; do -h|--help) (usage; exit 1) ; shift ;; -p|--provider) PROVIDER="$2" ; check_argval $2 ; shift 2 ;; -m|--masters) MASTERS="$2" ; check_argval $2 ; shift 2 ;; - -n|--minions) MINIONS="$2" ; check_argval $2 ; shift 2 ;; + -n|--nodes) NODES="$2" ; check_argval $2 ; shift 2 ;; --master-playbook) MASTER_PLAYBOOK="$2" ; check_argval $2 ; shift 2 ;; - --minion-playbook) MINION_PLAYBOOK="$2" ; check_argval $2 ; shift 2 ;; + --node-playbook) NODE_PLAYBOOK="$2" ; check_argval $2 ; shift 2 ;; --) shift ; break ;; *) break ;; esac diff --git a/playbooks/aws/openshift-master/config.yml b/playbooks/aws/openshift-master/config.yml index c8345aa2c..8a5873189 100644 --- a/playbooks/aws/openshift-master/config.yml +++ b/playbooks/aws/openshift-master/config.yml @@ -7,8 +7,8 @@ with_items: "{{ oo_host_group_exp | default('') }}" when: oo_host_group_exp is defined -- name: "Gather facts for minions in {{ oo_env }}" - hosts: "tag_env-host-type_{{ oo_env }}-openshift-minion" +- name: "Gather facts for nodes in {{ oo_env }}" + hosts: "tag_env-host-type_{{ oo_env }}-openshift-node" connection: ssh user: root @@ -16,12 +16,12 @@ hosts: localhost gather_facts: no tasks: - - name: Setting oo_minion_ips fact on localhost + - name: Setting oo_node_ips fact on localhost set_fact: - oo_minion_ips: "{{ hostvars - | oo_select_keys(groups['tag_env-host-type_' + oo_env + '-openshift-minion']) + oo_node_ips: "{{ hostvars + | oo_select_keys(groups['tag_env-host-type_' + oo_env + '-openshift-node']) | oo_collect(attribute='ansible_eth0.ipv4.address') }}" - when: groups['tag_env-host-type_' + oo_env + '-openshift-minion'] is defined + when: groups['tag_env-host-type_' + oo_env + '-openshift-node'] is defined - name: "Configure instances" hosts: oo_hosts_to_config @@ -34,7 +34,7 @@ - ../../../roles/repos - { role: ../../../roles/openshift_master, - oo_minion_ips: "{{ hostvars['localhost'].oo_minion_ips | default(['']) }}", + oo_node_ips: "{{ hostvars['localhost'].oo_node_ips | default(['']) }}", oo_bind_ip: "{{ hostvars[inventory_hostname].ansible_eth0.ipv4.address | default(['']) }}" } - ../../../roles/pods diff --git a/playbooks/aws/openshift-minion/config.yml b/playbooks/aws/openshift-minion/config.yml deleted file mode 100644 index b59ba5a9b..000000000 --- a/playbooks/aws/openshift-minion/config.yml +++ /dev/null @@ -1,40 +0,0 @@ -- name: "populate oo_hosts_to_config host group if needed" - hosts: localhost - gather_facts: no - tasks: - - name: Evaluate oo_host_group_exp - add_host: "name={{ item }} groups=oo_hosts_to_config" - with_items: "{{ oo_host_group_exp | default('') }}" - when: oo_host_group_exp is defined - -- name: "Gather facts for masters in {{ oo_env }}" - hosts: "tag_env-host-type_{{ oo_env }}-openshift-master" - connection: ssh - user: root - -- name: "Set OO sepcific facts on localhost (for later use)" - hosts: localhost - gather_facts: no - tasks: - - name: Setting oo_master_ips fact on localhost - set_fact: - oo_master_ips: "{{ hostvars - | oo_select_keys(groups['tag_env-host-type_' + oo_env + '-openshift-master']) - | oo_collect(attribute='ansible_eth0.ipv4.address') }}" - when: groups['tag_env-host-type_' + oo_env + '-openshift-master'] is defined - -- name: "Configure instances" - hosts: oo_hosts_to_config - connection: ssh - user: root - vars_files: - - vars.yml - roles: - - ../../../roles/base_os - - ../../../roles/repos - - ../../../roles/docker - - { - role: ../../../roles/openshift_minion, - oo_master_ips: "{{ hostvars['localhost'].oo_master_ips | default(['']) }}", - oo_bind_ip: "{{ hostvars[inventory_hostname].ansible_eth0.ipv4.address | default(['']) }}" - } diff --git a/playbooks/aws/openshift-minion/launch.yml b/playbooks/aws/openshift-minion/launch.yml deleted file mode 100644 index a889b93be..000000000 --- a/playbooks/aws/openshift-minion/launch.yml +++ /dev/null @@ -1,69 +0,0 @@ ---- -- name: Launch instance(s) - hosts: localhost - connection: local - gather_facts: no - - vars: - inst_region: us-east-1 - atomic_ami: ami-86781fee - user_data_file: user_data.txt - - vars_files: - - vars.yml - - tasks: - - name: Launch instances - ec2: - state: present - region: "{{ inst_region }}" - keypair: libra - group: ['public'] - instance_type: m3.large - image: "{{ atomic_ami }}" - count: "{{ oo_new_inst_names | oo_len }}" - user_data: "{{ lookup('file', user_data_file) }}" - wait: yes - register: ec2 - - - name: Add new instances public IPs to the atomic proxy host group - add_host: "hostname={{ item.public_ip }} groupname=new_ec2_instances" - with_items: ec2.instances - - - name: Add Name and environment tags to instances - ec2_tag: "resource={{ item.1.id }} region={{ inst_region }} state=present" - with_together: - - oo_new_inst_names - - ec2.instances - args: - tags: - Name: "{{ item.0 }}" - - - name: Add other tags to instances - ec2_tag: "resource={{ item.id }} region={{ inst_region }} state=present" - with_items: ec2.instances - args: - tags: "{{ oo_new_inst_tags }}" - - - name: Add new instances public IPs to oo_hosts_to_config - add_host: "hostname={{ item.0 }} ansible_ssh_host={{ item.1.dns_name }} groupname=oo_hosts_to_config" - with_together: - - oo_new_inst_names - - ec2.instances - - - debug: var=ec2 - - - name: Wait for ssh - wait_for: "port=22 host={{ item.dns_name }}" - with_items: ec2.instances - - - name: Wait for root user setup - command: "ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o ConnectTimeout=10 -o UserKnownHostsFile=/dev/null root@{{ item.dns_name }} echo root user is setup" - register: result - until: result.rc == 0 - retries: 20 - delay: 10 - with_items: ec2.instances - -# Apply the configs, seprate so that just the configs can be run by themselves -- include: config.yml diff --git a/playbooks/aws/openshift-minion/vars.yml b/playbooks/aws/openshift-minion/vars.yml deleted file mode 100644 index e69de29bb..000000000 diff --git a/playbooks/aws/openshift-node/config.yml b/playbooks/aws/openshift-node/config.yml new file mode 100644 index 000000000..2170f14a3 --- /dev/null +++ b/playbooks/aws/openshift-node/config.yml @@ -0,0 +1,40 @@ +- name: "populate oo_hosts_to_config host group if needed" + hosts: localhost + gather_facts: no + tasks: + - name: Evaluate oo_host_group_exp + add_host: "name={{ item }} groups=oo_hosts_to_config" + with_items: "{{ oo_host_group_exp | default('') }}" + when: oo_host_group_exp is defined + +- name: "Gather facts for masters in {{ oo_env }}" + hosts: "tag_env-host-type_{{ oo_env }}-openshift-master" + connection: ssh + user: root + +- name: "Set OO sepcific facts on localhost (for later use)" + hosts: localhost + gather_facts: no + tasks: + - name: Setting oo_master_ips fact on localhost + set_fact: + oo_master_ips: "{{ hostvars + | oo_select_keys(groups['tag_env-host-type_' + oo_env + '-openshift-master']) + | oo_collect(attribute='ansible_eth0.ipv4.address') }}" + when: groups['tag_env-host-type_' + oo_env + '-openshift-master'] is defined + +- name: "Configure instances" + hosts: oo_hosts_to_config + connection: ssh + user: root + vars_files: + - vars.yml + roles: + - ../../../roles/base_os + - ../../../roles/repos + - ../../../roles/docker + - { + role: ../../../roles/openshift_node, + oo_master_ips: "{{ hostvars['localhost'].oo_master_ips | default(['']) }}", + oo_bind_ip: "{{ hostvars[inventory_hostname].ansible_eth0.ipv4.address | default(['']) }}" + } diff --git a/playbooks/aws/openshift-node/launch.yml b/playbooks/aws/openshift-node/launch.yml new file mode 100644 index 000000000..a889b93be --- /dev/null +++ b/playbooks/aws/openshift-node/launch.yml @@ -0,0 +1,69 @@ +--- +- name: Launch instance(s) + hosts: localhost + connection: local + gather_facts: no + + vars: + inst_region: us-east-1 + atomic_ami: ami-86781fee + user_data_file: user_data.txt + + vars_files: + - vars.yml + + tasks: + - name: Launch instances + ec2: + state: present + region: "{{ inst_region }}" + keypair: libra + group: ['public'] + instance_type: m3.large + image: "{{ atomic_ami }}" + count: "{{ oo_new_inst_names | oo_len }}" + user_data: "{{ lookup('file', user_data_file) }}" + wait: yes + register: ec2 + + - name: Add new instances public IPs to the atomic proxy host group + add_host: "hostname={{ item.public_ip }} groupname=new_ec2_instances" + with_items: ec2.instances + + - name: Add Name and environment tags to instances + ec2_tag: "resource={{ item.1.id }} region={{ inst_region }} state=present" + with_together: + - oo_new_inst_names + - ec2.instances + args: + tags: + Name: "{{ item.0 }}" + + - name: Add other tags to instances + ec2_tag: "resource={{ item.id }} region={{ inst_region }} state=present" + with_items: ec2.instances + args: + tags: "{{ oo_new_inst_tags }}" + + - name: Add new instances public IPs to oo_hosts_to_config + add_host: "hostname={{ item.0 }} ansible_ssh_host={{ item.1.dns_name }} groupname=oo_hosts_to_config" + with_together: + - oo_new_inst_names + - ec2.instances + + - debug: var=ec2 + + - name: Wait for ssh + wait_for: "port=22 host={{ item.dns_name }}" + with_items: ec2.instances + + - name: Wait for root user setup + command: "ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o ConnectTimeout=10 -o UserKnownHostsFile=/dev/null root@{{ item.dns_name }} echo root user is setup" + register: result + until: result.rc == 0 + retries: 20 + delay: 10 + with_items: ec2.instances + +# Apply the configs, seprate so that just the configs can be run by themselves +- include: config.yml diff --git a/playbooks/aws/openshift-node/vars.yml b/playbooks/aws/openshift-node/vars.yml new file mode 100644 index 000000000..e69de29bb diff --git a/playbooks/gce/openshift-master/config.yml b/playbooks/gce/openshift-master/config.yml index f705bb305..cfdb5bbbe 100644 --- a/playbooks/gce/openshift-master/config.yml +++ b/playbooks/gce/openshift-master/config.yml @@ -7,8 +7,8 @@ with_items: "{{ oo_host_group_exp | default('') }}" when: oo_host_group_exp is defined -- name: "Gather facts for minions in {{ oo_env }}" - hosts: "tag_env-host-type-{{ oo_env }}-openshift-minion" +- name: "Gather facts for nodes in {{ oo_env }}" + hosts: "tag_env-host-type-{{ oo_env }}-openshift-node" connection: ssh user: root @@ -16,12 +16,12 @@ hosts: localhost gather_facts: no tasks: - - name: Setting oo_minion_ips fact on localhost + - name: Setting oo_node_ips fact on localhost set_fact: - oo_minion_ips: "{{ hostvars - | oo_select_keys(groups['tag_env-host-type-' + oo_env + '-openshift-minion']) + oo_node_ips: "{{ hostvars + | oo_select_keys(groups['tag_env-host-type-' + oo_env + '-openshift-node']) | oo_collect(attribute='ansible_eth0.ipv4.address') }}" - when: groups['tag_env-host-type-' + oo_env + '-openshift-minion'] is defined + when: groups['tag_env-host-type-' + oo_env + '-openshift-node'] is defined - name: "Configure instances" hosts: oo_hosts_to_config @@ -34,7 +34,8 @@ - ../../../roles/repos - { role: ../../../roles/openshift_master, - oo_minion_ips: "{{ hostvars['localhost'].oo_minion_ips | default(['']) }}", - oo_bind_ip: "{{ hostvars[inventory_hostname].ansible_eth0.ipv4.address | default(['']) }}" + oo_node_ips: "{{ hostvars['localhost'].oo_node_ips | default(['']) }}", + oo_bind_ip: "{{ hostvars[inventory_hostname].ansible_eth0.ipv4.address | default(['']) }}", + oo_public_ip: "{{ gce_public_ip }}" } - ../../../roles/pods diff --git a/playbooks/gce/openshift-minion/config.yml b/playbooks/gce/openshift-minion/config.yml deleted file mode 100644 index 0f78d4c76..000000000 --- a/playbooks/gce/openshift-minion/config.yml +++ /dev/null @@ -1,40 +0,0 @@ -- name: "populate oo_hosts_to_config host group if needed" - hosts: localhost - gather_facts: no - tasks: - - name: Evaluate oo_host_group_exp - add_host: "name={{ item }} groups=oo_hosts_to_config" - with_items: "{{ oo_host_group_exp | default('') }}" - when: oo_host_group_exp is defined - -- name: "Gather facts for masters in {{ oo_env }}" - hosts: "tag_env-host-type-{{ oo_env }}-openshift-master" - connection: ssh - user: root - -- name: "Set OO sepcific facts on localhost (for later use)" - hosts: localhost - gather_facts: no - tasks: - - name: Setting oo_master_ips fact on localhost - set_fact: - oo_master_ips: "{{ hostvars - | oo_select_keys(groups['tag_env-host-type-' + oo_env + '-openshift-master']) - | oo_collect(attribute='ansible_eth0.ipv4.address') }}" - when: groups['tag_env-host-type-' + oo_env + '-openshift-master'] is defined - -- name: "Configure instances" - hosts: oo_hosts_to_config - connection: ssh - user: root - vars_files: - - vars.yml - roles: - - ../../../roles/base_os - - ../../../roles/repos - - ../../../roles/docker - - { - role: ../../../roles/openshift_minion, - oo_master_ips: "{{ hostvars['localhost'].oo_master_ips | default(['']) }}", - oo_bind_ip: "{{ hostvars[inventory_hostname].ansible_eth0.ipv4.address | default(['']) }}" - } diff --git a/playbooks/gce/openshift-minion/launch.yml b/playbooks/gce/openshift-minion/launch.yml deleted file mode 100644 index f2800b061..000000000 --- a/playbooks/gce/openshift-minion/launch.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -- name: Launch instance(s) - hosts: localhost - connection: local - gather_facts: no - - vars: - inst_names: "{{ oo_new_inst_names }}" - machine_type: n1-standard-1 - image: libra-rhel7 - - vars_files: - - vars.yml - - tasks: - - name: Launch instances - gce: - instance_names: "{{ inst_names }}" - machine_type: "{{ machine_type }}" - image: "{{ image }}" - service_account_email: "{{ gce_service_account_email }}" - pem_file: "{{ gce_pem_file }}" - project_id: "{{ gce_project_id }}" - tags: "{{ oo_new_inst_tags }}" - register: gce - - - name: Add new instances public IPs to oo_hosts_to_config - add_host: "hostname={{ item.name }} ansible_ssh_host={{ item.public_ip }} groupname=oo_hosts_to_config" - with_items: gce.instance_data - - - name: Wait for ssh - wait_for: "port=22 host={{ item.public_ip }}" - with_items: gce.instance_data - - - debug: var=gce - - - name: Wait for root user setup - command: "ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o ConnectTimeout=10 -o UserKnownHostsFile=/dev/null root@{{ item.public_ip }} echo root user is setup" - register: result - until: result.rc == 0 - retries: 20 - delay: 10 - with_items: gce.instance_data - - -# Apply the configs, separate so that just the configs can be run by themselves -- include: config.yml diff --git a/playbooks/gce/openshift-minion/terminate.yml b/playbooks/gce/openshift-minion/terminate.yml deleted file mode 100644 index 97b31eca0..000000000 --- a/playbooks/gce/openshift-minion/terminate.yml +++ /dev/null @@ -1,41 +0,0 @@ -- name: "populate oo_hosts_to_terminate host group if needed" - hosts: localhost - gather_facts: no - tasks: - - debug: var=oo_host_group_exp - - - name: Evaluate oo_host_group_exp if it's set - add_host: "name={{ item }} groups=oo_hosts_to_terminate" - with_items: "{{ oo_host_group_exp | default('') }}" - when: oo_host_group_exp is defined - - - debug: msg="{{ groups['oo_hosts_to_terminate'] }}" - - -- name: Terminate instances - hosts: localhost - connection: local - tasks: - - name: Terminate minion instances - gce: - service_account_email: "{{ gce_service_account_email }}" - pem_file: "{{ gce_pem_file }}" - project_id: "{{ gce_project_id }}" - state: 'absent' - instance_names: "{{ groups['oo_hosts_to_terminate'] }}" - disks: "{{ groups['oo_hosts_to_terminate'] }}" - register: gce - - - debug: var=gce - - - name: Remove disks of instances - gce_pd: - service_account_email: "{{ gce_service_account_email }}" - pem_file: "{{ gce_pem_file }}" - project_id: "{{ gce_project_id }}" - name: "{{ item }}" - zone: "{{ gce.zone }}" - state: absent - with_items: gce.instance_names - - diff --git a/playbooks/gce/openshift-minion/vars.yml b/playbooks/gce/openshift-minion/vars.yml deleted file mode 100644 index e69de29bb..000000000 diff --git a/playbooks/gce/openshift-node/config.yml b/playbooks/gce/openshift-node/config.yml new file mode 100644 index 000000000..1f201902f --- /dev/null +++ b/playbooks/gce/openshift-node/config.yml @@ -0,0 +1,55 @@ +- name: "populate oo_hosts_to_config host group if needed" + hosts: localhost + gather_facts: no + tasks: + - name: Evaluate oo_host_group_exp + add_host: "name={{ item }} groups=oo_hosts_to_config" + with_items: "{{ oo_host_group_exp | default('') }}" + when: oo_host_group_exp is defined + +- name: "Gather facts for masters in {{ oo_env }}" + hosts: "tag_env-host-type-{{ oo_env }}-openshift-master" + connection: ssh + user: root + +- name: "Set OO sepcific facts on localhost (for later use)" + hosts: localhost + gather_facts: no + tasks: + - name: Setting oo_master_ips fact on localhost + set_fact: + oo_master_ips: "{{ hostvars + | oo_select_keys(groups['tag_env-host-type-' + oo_env + '-openshift-master']) + | oo_collect(attribute='ansible_eth0.ipv4.address') }}" + when: groups['tag_env-host-type-' + oo_env + '-openshift-master'] is defined + - name: Setting oo_master_public_ips fact on localhost + set_fact: + oo_master_public_ips: "{{ hostvars + | oo_select_keys(groups['tag_env-host-type-' + oo_env + '-openshift-master']) + | oo_collect(attribute='gce_public_ip') }}" + when: groups['tag_env-host-type-' + oo_env + '-openshift-master'] is defined + +- name: "Debug hostvars" + hosts: oo_hosts_to_config + connection: ssh + user: root + tasks: + - debug: var=hostvars + +- name: "Configure instances" + hosts: oo_hosts_to_config + connection: ssh + user: root + vars_files: + - vars.yml + roles: + - ../../../roles/base_os + - ../../../roles/repos + - ../../../roles/docker + - { + role: ../../../roles/openshift_node, + oo_master_ips: "{{ hostvars['localhost'].oo_master_ips | default(['']) }}", + oo_master_public_ips: "{{ hostvars['localhost'].oo_master_public_ips | default(['']) }}", + oo_bind_ip: "{{ hostvars[inventory_hostname].ansible_eth0.ipv4.address | default(['']) }}", + oo_public_ip: "{{ hostvars[inventory_hostname].ansible_ssh_host }}" + } diff --git a/playbooks/gce/openshift-node/launch.yml b/playbooks/gce/openshift-node/launch.yml new file mode 100644 index 000000000..f2800b061 --- /dev/null +++ b/playbooks/gce/openshift-node/launch.yml @@ -0,0 +1,47 @@ +--- +- name: Launch instance(s) + hosts: localhost + connection: local + gather_facts: no + + vars: + inst_names: "{{ oo_new_inst_names }}" + machine_type: n1-standard-1 + image: libra-rhel7 + + vars_files: + - vars.yml + + tasks: + - name: Launch instances + gce: + instance_names: "{{ inst_names }}" + machine_type: "{{ machine_type }}" + image: "{{ image }}" + service_account_email: "{{ gce_service_account_email }}" + pem_file: "{{ gce_pem_file }}" + project_id: "{{ gce_project_id }}" + tags: "{{ oo_new_inst_tags }}" + register: gce + + - name: Add new instances public IPs to oo_hosts_to_config + add_host: "hostname={{ item.name }} ansible_ssh_host={{ item.public_ip }} groupname=oo_hosts_to_config" + with_items: gce.instance_data + + - name: Wait for ssh + wait_for: "port=22 host={{ item.public_ip }}" + with_items: gce.instance_data + + - debug: var=gce + + - name: Wait for root user setup + command: "ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o ConnectTimeout=10 -o UserKnownHostsFile=/dev/null root@{{ item.public_ip }} echo root user is setup" + register: result + until: result.rc == 0 + retries: 20 + delay: 10 + with_items: gce.instance_data + + +# Apply the configs, separate so that just the configs can be run by themselves +- include: config.yml diff --git a/playbooks/gce/openshift-node/terminate.yml b/playbooks/gce/openshift-node/terminate.yml new file mode 100644 index 000000000..8d60f27b3 --- /dev/null +++ b/playbooks/gce/openshift-node/terminate.yml @@ -0,0 +1,41 @@ +- name: "populate oo_hosts_to_terminate host group if needed" + hosts: localhost + gather_facts: no + tasks: + - debug: var=oo_host_group_exp + + - name: Evaluate oo_host_group_exp if it's set + add_host: "name={{ item }} groups=oo_hosts_to_terminate" + with_items: "{{ oo_host_group_exp | default('') }}" + when: oo_host_group_exp is defined + + - debug: msg="{{ groups['oo_hosts_to_terminate'] }}" + + +- name: Terminate instances + hosts: localhost + connection: local + tasks: + - name: Terminate node instances + gce: + service_account_email: "{{ gce_service_account_email }}" + pem_file: "{{ gce_pem_file }}" + project_id: "{{ gce_project_id }}" + state: 'absent' + instance_names: "{{ groups['oo_hosts_to_terminate'] }}" + disks: "{{ groups['oo_hosts_to_terminate'] }}" + register: gce + + - debug: var=gce + + - name: Remove disks of instances + gce_pd: + service_account_email: "{{ gce_service_account_email }}" + pem_file: "{{ gce_pem_file }}" + project_id: "{{ gce_project_id }}" + name: "{{ item }}" + zone: "{{ gce.zone }}" + state: absent + with_items: gce.instance_names + + diff --git a/playbooks/gce/openshift-node/vars.yml b/playbooks/gce/openshift-node/vars.yml new file mode 100644 index 000000000..e69de29bb diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index 2223bb675..2e9de3abe 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -1,7 +1,7 @@ --- # tasks file for docker - name: Install docker - yum: pkg=docker + yum: pkg=docker-io - name: enable docker service command: /usr/bin/systemctl enable docker.service diff --git a/roles/kubernetes_apiserver/tasks/main.yml b/roles/kubernetes_apiserver/tasks/main.yml index 81fdbbb40..995c2702e 100644 --- a/roles/kubernetes_apiserver/tasks/main.yml +++ b/roles/kubernetes_apiserver/tasks/main.yml @@ -9,7 +9,7 @@ regexp: "{{ item.regex }}" line: "{{ item.line }}" with_items: - - { regex: '^KUBE_API_MACHINES=', line: 'KUBE_API_MACHINES=\"{{ oo_minion_ips | join(",") }}\"' } + - { regex: '^KUBE_API_MACHINES=', line: 'KUBE_API_MACHINES=\"{{ oo_node_ips | join(",") }}\"' } - { regex: '^KUBE_API_ADDRESS=', line: 'KUBE_API_ADDRESS=\"0.0.0.0\"' } notify: - restart kubernetes-apiserver diff --git a/roles/openshift_master/handlers/main.yml b/roles/openshift_master/handlers/main.yml index 216af5dc9..5c30dccab 100644 --- a/roles/openshift_master/handlers/main.yml +++ b/roles/openshift_master/handlers/main.yml @@ -1,4 +1,4 @@ --- # handlers file for openshift_master - name: restart openshift-master - service: name=openshift state=restarted + service: name=openshift-master state=restarted diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml index 6826ef452..9f28a3469 100644 --- a/roles/openshift_master/tasks/main.yml +++ b/roles/openshift_master/tasks/main.yml @@ -1,20 +1,19 @@ --- # tasks file for openshift_master - name: Install Origin - yum: pkg=origin state=installed + yum: pkg=openshift-master state=installed - # fixme: Once openshift stops resolving hostnames for minion queries remove this... + # fixme: Once openshift stops resolving hostnames for node queries remove this... - name: Set hostname to IP Addr (WORKAROUND) command: /usr/bin/hostname {{ oo_bind_ip }} - name: Configure OpenShift Master settings lineinfile: - dest: /etc/sysconfig/openshift + dest: /etc/sysconfig/openshift-master regexp: "{{ item.regex }}" line: "{{ item.line }}" with_items: - - { regex: '^ROLE=', line: 'ROLE=\"master\"' } - - { regex: '^OPTIONS=', line: 'OPTIONS=\"--nodes={{ oo_minion_ips | join(",") }} --loglevel=5\"' } + - { regex: '^OPTIONS=', line: 'OPTIONS=\"--public-master={{ oo_public_ip }} --nodes={{ oo_node_ips | join(",") }} --loglevel=5\"' } notify: - restart openshift-master @@ -31,4 +30,4 @@ firewalld: port=8080/tcp permanent=true state=enabled - name: Enable OpenShift - service: name=openshift enabled=yes state=started + service: name=openshift-master enabled=yes state=started diff --git a/roles/openshift_minion/README.md b/roles/openshift_minion/README.md deleted file mode 100644 index 225dd44b9..000000000 --- a/roles/openshift_minion/README.md +++ /dev/null @@ -1,38 +0,0 @@ -Role Name -========= - -A brief description of the role goes here. - -Requirements ------------- - -Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. - -Role Variables --------------- - -A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. - -Dependencies ------------- - -A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } - -License -------- - -BSD - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/openshift_minion/defaults/main.yml b/roles/openshift_minion/defaults/main.yml deleted file mode 100644 index dfcf3d98f..000000000 --- a/roles/openshift_minion/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for openshift_minion diff --git a/roles/openshift_minion/handlers/main.yml b/roles/openshift_minion/handlers/main.yml deleted file mode 100644 index 2764456f4..000000000 --- a/roles/openshift_minion/handlers/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# handlers file for openshift_minion -- name: restart openshift-minion - service: name=openshift state=restarted diff --git a/roles/openshift_minion/meta/main.yml b/roles/openshift_minion/meta/main.yml deleted file mode 100644 index c5c362c60..000000000 --- a/roles/openshift_minion/meta/main.yml +++ /dev/null @@ -1,124 +0,0 @@ ---- -galaxy_info: - author: your name - description: - company: your company (optional) - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - min_ansible_version: 1.2 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - #platforms: - #- name: EL - # versions: - # - all - # - 5 - # - 6 - # - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Fedora - # versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - #- name: Ubuntu - # versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - # - trusty - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - #- name: Debian - # versions: - # - all - # - etch - # - lenny - # - squeeze - # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - #categories: - #- cloud - #- cloud:ec2 - #- cloud:gce - #- cloud:rax - #- clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - #- networking - #- packaging - #- system - #- web -dependencies: [] - # List your role dependencies here, one per line. Only - # dependencies available via galaxy should be listed here. - # Be sure to remove the '[]' above if you add dependencies - # to this list. - diff --git a/roles/openshift_minion/tasks/main.yml b/roles/openshift_minion/tasks/main.yml deleted file mode 100644 index 3821277bc..000000000 --- a/roles/openshift_minion/tasks/main.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -# tasks file for openshift_minion -- name: Install OpenShift - yum: pkg=origin state=installed - - # fixme: Once openshift stops resolving hostnames for minion queries remove this... -- name: Set hostname to IP Addr (WORKAROUND) - command: /usr/bin/hostname {{ oo_bind_ip }} - -- name: Configure OpenShift Minion settings - lineinfile: - dest: /etc/sysconfig/openshift - regexp: "{{ item.regex }}" - line: "{{ item.line }}" - with_items: - - { regex: '^ROLE=', line: 'ROLE=\"node\"' } - - { regex: '^OPTIONS=', line: 'OPTIONS=\"--master=http://{{ oo_master_ips[0] }}:8080 --loglevel=5\"' } - notify: - - restart openshift-minion - -- name: Open firewalld port for OpenShift - firewalld: port=10250/tcp permanent=false state=enabled - -- name: Save firewalld port for OpenShift - firewalld: port=10250/tcp permanent=true state=enabled - -- name: Enable OpenShift - service: name=openshift enabled=yes state=started - diff --git a/roles/openshift_minion/vars/main.yml b/roles/openshift_minion/vars/main.yml deleted file mode 100644 index 715fba487..000000000 --- a/roles/openshift_minion/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for openshift_minion diff --git a/roles/openshift_node/README.md b/roles/openshift_node/README.md new file mode 100644 index 000000000..225dd44b9 --- /dev/null +++ b/roles/openshift_node/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/openshift_node/defaults/main.yml b/roles/openshift_node/defaults/main.yml new file mode 100644 index 000000000..af92e96d7 --- /dev/null +++ b/roles/openshift_node/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for openshift_node diff --git a/roles/openshift_node/files/sysconfig/kubeconfig b/roles/openshift_node/files/sysconfig/kubeconfig new file mode 100644 index 000000000..81e660ae4 --- /dev/null +++ b/roles/openshift_node/files/sysconfig/kubeconfig @@ -0,0 +1,40 @@ +apiVersion: v1 +clusters: +- cluster: + api-version: v1beta1 + server: http://cow.org:8080 + name: cow-cluster +- cluster: + certificate-authority: path/to/my/cafile + server: https://horse.org:4443 + name: horse-cluster +- cluster: + insecure-skip-tls-verify: true + server: https://pig.org:443 + name: pig-cluster +contexts: +- context: + cluster: horse-cluster + namespace: chisel-ns + user: green-user + name: federal-context +- context: + cluster: pig-cluster + namespace: saw-ns + user: black-user + name: queen-anne-context +current-context: federal-context +kind: Config +preferences: + colors: true +users: +- name: black-user + user: + auth-path: path/to/my/existing/.kubernetes_auth_file +- name: blue-user + user: + token: blue-token +- name: green-user + user: + client-certificate: path/to/my/client/cert + client-key: path/to/my/client/key diff --git a/roles/openshift_node/handlers/main.yml b/roles/openshift_node/handlers/main.yml new file mode 100644 index 000000000..afbb5a53f --- /dev/null +++ b/roles/openshift_node/handlers/main.yml @@ -0,0 +1,4 @@ +--- +# handlers file for openshift_node +- name: restart openshift-node + service: name=openshift-node state=restarted diff --git a/roles/openshift_node/meta/main.yml b/roles/openshift_node/meta/main.yml new file mode 100644 index 000000000..c5c362c60 --- /dev/null +++ b/roles/openshift_node/meta/main.yml @@ -0,0 +1,124 @@ +--- +galaxy_info: + author: your name + description: + company: your company (optional) + # Some suggested licenses: + # - BSD (default) + # - MIT + # - GPLv2 + # - GPLv3 + # - Apache + # - CC-BY + license: license (GPLv2, CC-BY, etc) + min_ansible_version: 1.2 + # + # Below are all platforms currently available. Just uncomment + # the ones that apply to your role. If you don't see your + # platform on this list, let us know and we'll get it added! + # + #platforms: + #- name: EL + # versions: + # - all + # - 5 + # - 6 + # - 7 + #- name: GenericUNIX + # versions: + # - all + # - any + #- name: Fedora + # versions: + # - all + # - 16 + # - 17 + # - 18 + # - 19 + # - 20 + #- name: opensuse + # versions: + # - all + # - 12.1 + # - 12.2 + # - 12.3 + # - 13.1 + # - 13.2 + #- name: Amazon + # versions: + # - all + # - 2013.03 + # - 2013.09 + #- name: GenericBSD + # versions: + # - all + # - any + #- name: FreeBSD + # versions: + # - all + # - 8.0 + # - 8.1 + # - 8.2 + # - 8.3 + # - 8.4 + # - 9.0 + # - 9.1 + # - 9.1 + # - 9.2 + #- name: Ubuntu + # versions: + # - all + # - lucid + # - maverick + # - natty + # - oneiric + # - precise + # - quantal + # - raring + # - saucy + # - trusty + #- name: SLES + # versions: + # - all + # - 10SP3 + # - 10SP4 + # - 11 + # - 11SP1 + # - 11SP2 + # - 11SP3 + #- name: GenericLinux + # versions: + # - all + # - any + #- name: Debian + # versions: + # - all + # - etch + # - lenny + # - squeeze + # - wheezy + # + # Below are all categories currently available. Just as with + # the platforms above, uncomment those that apply to your role. + # + #categories: + #- cloud + #- cloud:ec2 + #- cloud:gce + #- cloud:rax + #- clustering + #- database + #- database:nosql + #- database:sql + #- development + #- monitoring + #- networking + #- packaging + #- system + #- web +dependencies: [] + # List your role dependencies here, one per line. Only + # dependencies available via galaxy should be listed here. + # Be sure to remove the '[]' above if you add dependencies + # to this list. + diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml new file mode 100644 index 000000000..9da269888 --- /dev/null +++ b/roles/openshift_node/tasks/main.yml @@ -0,0 +1,38 @@ +--- +# tasks file for openshift_node +- name: Install OpenShift + yum: pkg=openshift-node state=installed + + # fixme: Once openshift stops resolving hostnames for node queries remove this... +- name: Set hostname to IP Addr (WORKAROUND) + command: /usr/bin/hostname {{ oo_bind_ip }} + +- name: Retrieve OpenShift Master credentials + local_action: command /usr/bin/rsync --compress --archive --rsh 'ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' root@{{ oo_master_public_ips[0] }}:/var/lib/openshift/openshift.local.certificates/admin/ /tmp/openshift + ignore_errors: yes + +- file: path=/var/lib/openshift/openshift.local.certificates/admin state=directory + +- name: Store OpenShift Master credentials + local_action: command /usr/bin/rsync --compress --archive --rsh 'ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' /tmp/openshift/ root@{{ oo_public_ip }}:/var/lib/openshift/openshift.local.certificates/admin + ignore_errors: yes + +- name: Configure OpenShift Node settings + lineinfile: + dest: /etc/sysconfig/openshift-node + regexp: "{{ item.regex }}" + line: "{{ item.line }}" + with_items: + - { regex: '^OPTIONS=', line: 'OPTIONS=\"--master=http://{{ oo_master_ips[0] }}:8080 --loglevel=5\"' } + notify: + - restart openshift-node + +- name: Open firewalld port for OpenShift + firewalld: port=10250/tcp permanent=false state=enabled + +- name: Save firewalld port for OpenShift + firewalld: port=10250/tcp permanent=true state=enabled + +- name: Enable OpenShift + service: name=openshift-node enabled=yes state=started + diff --git a/roles/openshift_node/vars/main.yml b/roles/openshift_node/vars/main.yml new file mode 100644 index 000000000..3184e8ac7 --- /dev/null +++ b/roles/openshift_node/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for openshift_node diff --git a/roles/repos/files/epel7-openshift.repo b/roles/repos/files/epel7-openshift.repo new file mode 100644 index 000000000..c7629872d --- /dev/null +++ b/roles/repos/files/epel7-openshift.repo @@ -0,0 +1,6 @@ +[maxamillion-origin-next] +name=Copr repo for origin-next owned by maxamillion +baseurl=http://copr-be.cloud.fedoraproject.org/results/maxamillion/origin-next/epel-7-$basearch/ +skip_if_unavailable=False +gpgcheck=0 +enabled=1 diff --git a/roles/repos/files/epel7-origin.repo b/roles/repos/files/epel7-origin.repo deleted file mode 100644 index c7629872d..000000000 --- a/roles/repos/files/epel7-origin.repo +++ /dev/null @@ -1,6 +0,0 @@ -[maxamillion-origin-next] -name=Copr repo for origin-next owned by maxamillion -baseurl=http://copr-be.cloud.fedoraproject.org/results/maxamillion/origin-next/epel-7-$basearch/ -skip_if_unavailable=False -gpgcheck=0 -enabled=1 diff --git a/roles/repos/files/oso-rhui-rhel-7-server.repo b/roles/repos/files/oso-rhui-rhel-7-server.repo index d32070634..fa182cb0a 100644 --- a/roles/repos/files/oso-rhui-rhel-7-server.repo +++ b/roles/repos/files/oso-rhui-rhel-7-server.repo @@ -1,13 +1,45 @@ -[oso-rhel-7-server] -name=Red Hat Enterprise Linux 7 Server from RHUI (RPMs) -baseurl=http://10.240.169.148/mirror/rhui-rhel-server-7-releases +[oso-rhui-rhel-server-releases] +name=OpenShift Online RHUI Mirror RH Enterprise Linux $majorrelease +baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhui-rhel-server-$majorrelease-releases/ + https://mirror.ops.rhcloud.com/libra/rhui-rhel-server-$majorrelease-releases/ enabled=1 gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +gpgkey=file:///srv/libra/keys/RPM-GPG-KEY-redhat-release +sslverify=False +sslclientcert=/var/lib/yum/client-cert.pem +sslclientkey=/var/lib/yum/client-key.pem -[oso-rhel-7-server-optional] -name=Red Hat Enterprise Linux 7 Server - Optional from RHUI (RPMs) -baseurl=http://10.240.169.148/mirror/rhui-rhel-server-7-releases-optional +[oso-rhui-rhel-server-releases-optional] +name=OpenShift Online RHUI Mirror RH Enterprise Linux $majorrelease - Optional +baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhui-rhel-server-$majorrelease-releases-optional/ + https://mirror.ops.rhcloud.com/libra/rhui-rhel-server-$majorrelease-releases-optional/ enabled=1 gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +gpgkey=file:///srv/libra/keys/RPM-GPG-KEY-redhat-release +sslverify=False +sslclientcert=/var/lib/yum/client-cert.pem +sslclientkey=/var/lib/yum/client-key.pem + +[oso-rhui-rhel-server-extras] +name=OpenShift Online RHUI Mirror RH Enterprise Linux - Extras +baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhui-rhel-server-$majorrelease-extras/ + https://mirror.ops.rhcloud.com/libra/rhui-rhel-server-$majorrelease-extras/ +enabled=1 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta +failovermethod=priority +sslverify=False +sslclientcert=/var/lib/yum/client-cert.pem +sslclientkey=/var/lib/yum/client-key.pem + +[oso-rhui-rhel-server-extras-htb] +name=OpenShift Online RHUI Mirror RH Enterprise Linux - Extras HTB +baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhui-rhel-server-$majorrelease-extras-htb/ + https://mirror.ops.rhcloud.com/libra/rhui-rhel-server-$majorrelease-extras-htb/ +enabled=0 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta +failovermethod=priority +sslverify=False +sslclientcert=/var/lib/yum/client-cert.pem +sslclientkey=/var/lib/yum/client-key.pem diff --git a/roles/repos/tasks/main.yaml b/roles/repos/tasks/main.yaml index 3b66bb392..cb4b5ad40 100644 --- a/roles/repos/tasks/main.yaml +++ b/roles/repos/tasks/main.yaml @@ -10,4 +10,7 @@ copy: src=epel7-kubernetes.repo dest=/etc/yum.repos.d/epel7-kubernetes.repo - name: Ensure the origin repo is available - copy: src=epel7-origin.repo dest=/etc/yum.repos.d/epel7-origin.repo + copy: src=epel7-openshift.repo dest=/etc/yum.repos.d/epel7-openshift.repo + +- name: Ensure the rhel repo is available + copy: src=oso-rhui-rhel-7-server.repo dest=/etc/yum.repos.d/oso-rhui-rhel-7-server.repo -- cgit v1.2.3 From 90010f6db6294a99c56194afd89a0359a3d278dc Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Mon, 16 Feb 2015 17:57:08 -0700 Subject: Update code to reflect review comments --- playbooks/gce/openshift-node/config.yml | 15 +++++++-------- roles/openshift_node/tasks/main.yml | 7 +++++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/playbooks/gce/openshift-node/config.yml b/playbooks/gce/openshift-node/config.yml index 1f201902f..10016463b 100644 --- a/playbooks/gce/openshift-node/config.yml +++ b/playbooks/gce/openshift-node/config.yml @@ -1,6 +1,7 @@ - name: "populate oo_hosts_to_config host group if needed" hosts: localhost gather_facts: no + tasks: - name: Evaluate oo_host_group_exp add_host: "name={{ item }} groups=oo_hosts_to_config" @@ -29,17 +30,14 @@ | oo_collect(attribute='gce_public_ip') }}" when: groups['tag_env-host-type-' + oo_env + '-openshift-master'] is defined -- name: "Debug hostvars" - hosts: oo_hosts_to_config - connection: ssh - user: root - tasks: - - debug: var=hostvars - - name: "Configure instances" hosts: oo_hosts_to_config connection: ssh user: root + + vars: + tmp_dir: "/tmp/openshift-{{ 9999 | random }}" + vars_files: - vars.yml roles: @@ -51,5 +49,6 @@ oo_master_ips: "{{ hostvars['localhost'].oo_master_ips | default(['']) }}", oo_master_public_ips: "{{ hostvars['localhost'].oo_master_public_ips | default(['']) }}", oo_bind_ip: "{{ hostvars[inventory_hostname].ansible_eth0.ipv4.address | default(['']) }}", - oo_public_ip: "{{ hostvars[inventory_hostname].ansible_ssh_host }}" + oo_public_ip: "{{ hostvars[inventory_hostname].ansible_ssh_host }}", + tmp_dir: "{{ tmp_dir }}" } diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml index 9da269888..73383da2c 100644 --- a/roles/openshift_node/tasks/main.yml +++ b/roles/openshift_node/tasks/main.yml @@ -1,4 +1,5 @@ --- + # tasks file for openshift_node - name: Install OpenShift yum: pkg=openshift-node state=installed @@ -8,13 +9,14 @@ command: /usr/bin/hostname {{ oo_bind_ip }} - name: Retrieve OpenShift Master credentials - local_action: command /usr/bin/rsync --compress --archive --rsh 'ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' root@{{ oo_master_public_ips[0] }}:/var/lib/openshift/openshift.local.certificates/admin/ /tmp/openshift + local_action: command /usr/bin/rsync --compress --archive --rsh 'ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' root@{{ oo_master_public_ips[0] }}:/var/lib/openshift/openshift.local.certificates/admin/ {{ tmp_dir }} ignore_errors: yes - file: path=/var/lib/openshift/openshift.local.certificates/admin state=directory +- file: path={{ tmp_dir }} state=directory - name: Store OpenShift Master credentials - local_action: command /usr/bin/rsync --compress --archive --rsh 'ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' /tmp/openshift/ root@{{ oo_public_ip }}:/var/lib/openshift/openshift.local.certificates/admin + local_action: command /usr/bin/rsync --compress --archive --rsh 'ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' {{ tmp_dir }}/ root@{{ oo_public_ip }}:/var/lib/openshift/openshift.local.certificates/admin ignore_errors: yes - name: Configure OpenShift Node settings @@ -36,3 +38,4 @@ - name: Enable OpenShift service: name=openshift-node enabled=yes state=started +- file: name={{ tmp_dir }} state=absent -- cgit v1.2.3 From 5825d847da539256de3a7e4eef2dcbc38c198d0a Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Tue, 17 Feb 2015 08:37:32 -0600 Subject: remove the add-hoc docker repo Fix up libra candidate repo config file Fix up rhel 7 rhui repo config file Add rhel 7 rhui extras repo, which has docker in it Separate rhel 7 extras into its own config file Add rhel 7 extras so that we have docker --- roles/repos/files/docker.repo | 5 ----- roles/repos/files/oso-rhui-rhel-7-extras.repo | 10 ++++++++++ roles/repos/files/oso-rhui-rhel-7-server.repo | 12 ++++++++++-- roles/repos/files/rhel-7-libra-candidate.repo | 5 +++-- roles/repos/tasks/main.yaml | 4 ++-- 5 files changed, 25 insertions(+), 11 deletions(-) delete mode 100644 roles/repos/files/docker.repo create mode 100644 roles/repos/files/oso-rhui-rhel-7-extras.repo diff --git a/roles/repos/files/docker.repo b/roles/repos/files/docker.repo deleted file mode 100644 index 5722284f5..000000000 --- a/roles/repos/files/docker.repo +++ /dev/null @@ -1,5 +0,0 @@ -[docker] -name= Temporary Docker rpm -baseurl=http://10.240.169.148/mirror/docker -gpgcheck=0 -enabled=0 diff --git a/roles/repos/files/oso-rhui-rhel-7-extras.repo b/roles/repos/files/oso-rhui-rhel-7-extras.repo new file mode 100644 index 000000000..3a7bfbb81 --- /dev/null +++ b/roles/repos/files/oso-rhui-rhel-7-extras.repo @@ -0,0 +1,10 @@ +[oso-rhel-7-server-extras] +name=Red Hat Enterprise Linux 7 Server - Extras from RHUI (RPMs) +baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhui-rhel-server-7-extras/ + https://mirror.ops.rhcloud.com/libra/rhui-rhel-server-7-extras/ +enabled=1 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +sslclientcert=/var/lib/yum/client-cert.pem +sslclientkey=/var/lib/yum/client-key.pem +sslverify=False diff --git a/roles/repos/files/oso-rhui-rhel-7-server.repo b/roles/repos/files/oso-rhui-rhel-7-server.repo index d32070634..4773d0fe2 100644 --- a/roles/repos/files/oso-rhui-rhel-7-server.repo +++ b/roles/repos/files/oso-rhui-rhel-7-server.repo @@ -1,13 +1,21 @@ [oso-rhel-7-server] name=Red Hat Enterprise Linux 7 Server from RHUI (RPMs) -baseurl=http://10.240.169.148/mirror/rhui-rhel-server-7-releases +baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhui-rhel-server-7-releases/ + https://mirror.ops.rhcloud.com/libra/rhui-rhel-server-7-releases/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +sslclientcert=/var/lib/yum/client-cert.pem +sslclientkey=/var/lib/yum/client-key.pem +sslverify=False [oso-rhel-7-server-optional] name=Red Hat Enterprise Linux 7 Server - Optional from RHUI (RPMs) -baseurl=http://10.240.169.148/mirror/rhui-rhel-server-7-releases-optional +baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhui-rhel-server-7-releases-optional/ + https://mirror.ops.rhcloud.com/libra/rhui-rhel-server-7-releases-optional/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +sslclientcert=/var/lib/yum/client-cert.pem +sslclientkey=/var/lib/yum/client-key.pem +sslverify=False diff --git a/roles/repos/files/rhel-7-libra-candidate.repo b/roles/repos/files/rhel-7-libra-candidate.repo index 0901bf707..b4215679f 100644 --- a/roles/repos/files/rhel-7-libra-candidate.repo +++ b/roles/repos/files/rhel-7-libra-candidate.repo @@ -1,7 +1,8 @@ [rhel-7-libra-candidate] name=rhel-7-libra-candidate - \$basearch -baseurl=https://mirror1.ops.rhcloud.com/libra/rhel-7-libra-candidate/\$basearch/ -gpgkey=https://mirror1.ops.rhcloud.com/libra/RPM-GPG-KEY-redhat-release https://mirror1.ops.rhcloud.com/libra/RPM-GPG-KEY-redhat-beta https://mirror1.ops.rhcloud.com/libra/RPM-GPG-KEY-redhat-openshifthosted +baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhel-7-libra-candidate/\$basearch/ + https://mirror.ops.rhcloud.com/libra/rhel-7-libra-candidate/\$basearch/ +gpgkey=https://mirror.ops.rhcloud.com/libra/RPM-GPG-KEY-redhat-openshifthosted skip_if_unavailable=True gpgcheck=0 enabled=1 diff --git a/roles/repos/tasks/main.yaml b/roles/repos/tasks/main.yaml index 3b66bb392..e5c9a7f92 100644 --- a/roles/repos/tasks/main.yaml +++ b/roles/repos/tasks/main.yaml @@ -3,8 +3,8 @@ - name: Ensure rhel 7 libra candidate exists in yum.repos.d copy: src=rhel-7-libra-candidate.repo dest=/etc/yum.repos.d/rhel-7-libra-candidate.repo -- name: Ensure a docker repo is laid down - copy: src=docker.repo dest=/etc/yum.repos.d/docker.repo +- name: Ensure rhel 7 extras exists in yum.repos.d + copy: src=oso-rhui-rhel-7-extras.repo dest=/etc/yum.repos.d/oso-rhui-rhel-7-extras.repo - name: Ensure the kubernetes repo is available copy: src=epel7-kubernetes.repo dest=/etc/yum.repos.d/epel7-kubernetes.repo -- cgit v1.2.3 From 16ab19a24e6e2122f3f1b8f229b8bb20c88045cd Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Tue, 17 Feb 2015 10:07:09 -0700 Subject: * Use hostname module * Use mktemp for scratch directory --- playbooks/gce/openshift-node/config.yml | 7 +---- roles/openshift_node/files/sysconfig/kubeconfig | 40 ------------------------- roles/openshift_node/tasks/main.yml | 13 ++++---- 3 files changed, 9 insertions(+), 51 deletions(-) delete mode 100644 roles/openshift_node/files/sysconfig/kubeconfig diff --git a/playbooks/gce/openshift-node/config.yml b/playbooks/gce/openshift-node/config.yml index 10016463b..c9cacbc63 100644 --- a/playbooks/gce/openshift-node/config.yml +++ b/playbooks/gce/openshift-node/config.yml @@ -34,10 +34,6 @@ hosts: oo_hosts_to_config connection: ssh user: root - - vars: - tmp_dir: "/tmp/openshift-{{ 9999 | random }}" - vars_files: - vars.yml roles: @@ -49,6 +45,5 @@ oo_master_ips: "{{ hostvars['localhost'].oo_master_ips | default(['']) }}", oo_master_public_ips: "{{ hostvars['localhost'].oo_master_public_ips | default(['']) }}", oo_bind_ip: "{{ hostvars[inventory_hostname].ansible_eth0.ipv4.address | default(['']) }}", - oo_public_ip: "{{ hostvars[inventory_hostname].ansible_ssh_host }}", - tmp_dir: "{{ tmp_dir }}" + oo_public_ip: "{{ hostvars[inventory_hostname].ansible_ssh_host }}" } diff --git a/roles/openshift_node/files/sysconfig/kubeconfig b/roles/openshift_node/files/sysconfig/kubeconfig deleted file mode 100644 index 81e660ae4..000000000 --- a/roles/openshift_node/files/sysconfig/kubeconfig +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: v1 -clusters: -- cluster: - api-version: v1beta1 - server: http://cow.org:8080 - name: cow-cluster -- cluster: - certificate-authority: path/to/my/cafile - server: https://horse.org:4443 - name: horse-cluster -- cluster: - insecure-skip-tls-verify: true - server: https://pig.org:443 - name: pig-cluster -contexts: -- context: - cluster: horse-cluster - namespace: chisel-ns - user: green-user - name: federal-context -- context: - cluster: pig-cluster - namespace: saw-ns - user: black-user - name: queen-anne-context -current-context: federal-context -kind: Config -preferences: - colors: true -users: -- name: black-user - user: - auth-path: path/to/my/existing/.kubernetes_auth_file -- name: blue-user - user: - token: blue-token -- name: green-user - user: - client-certificate: path/to/my/client/cert - client-key: path/to/my/client/key diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml index 73383da2c..f1b2e9ac0 100644 --- a/roles/openshift_node/tasks/main.yml +++ b/roles/openshift_node/tasks/main.yml @@ -6,17 +6,20 @@ # fixme: Once openshift stops resolving hostnames for node queries remove this... - name: Set hostname to IP Addr (WORKAROUND) - command: /usr/bin/hostname {{ oo_bind_ip }} + hostname: name={{ oo_bind_ip }} + +- local_action: command /usr/bin/mktemp -d /tmp/openshift-ansible-XXXXXXX + register: mktemp - name: Retrieve OpenShift Master credentials - local_action: command /usr/bin/rsync --compress --archive --rsh 'ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' root@{{ oo_master_public_ips[0] }}:/var/lib/openshift/openshift.local.certificates/admin/ {{ tmp_dir }} + local_action: command /usr/bin/rsync --compress --archive --rsh 'ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' root@{{ oo_master_public_ips[0] }}:/var/lib/openshift/openshift.local.certificates/admin/ {{ mktemp.stdout }} ignore_errors: yes - file: path=/var/lib/openshift/openshift.local.certificates/admin state=directory -- file: path={{ tmp_dir }} state=directory +- file: path={{ mktemp.stdout }} state=directory - name: Store OpenShift Master credentials - local_action: command /usr/bin/rsync --compress --archive --rsh 'ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' {{ tmp_dir }}/ root@{{ oo_public_ip }}:/var/lib/openshift/openshift.local.certificates/admin + local_action: command /usr/bin/rsync --compress --archive --rsh 'ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' {{ mktemp.stdout }}/ root@{{ oo_public_ip }}:/var/lib/openshift/openshift.local.certificates/admin ignore_errors: yes - name: Configure OpenShift Node settings @@ -38,4 +41,4 @@ - name: Enable OpenShift service: name=openshift-node enabled=yes state=started -- file: name={{ tmp_dir }} state=absent +- file: name={{ mktemp.stdout }} state=absent -- cgit v1.2.3 From aa6c548d4bae31526e22116967d730f6ecb528c0 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Tue, 17 Feb 2015 10:39:36 -0700 Subject: * CRUD temp directory on local machine --- roles/openshift_node/tasks/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml index f1b2e9ac0..e0041a90c 100644 --- a/roles/openshift_node/tasks/main.yml +++ b/roles/openshift_node/tasks/main.yml @@ -16,7 +16,6 @@ ignore_errors: yes - file: path=/var/lib/openshift/openshift.local.certificates/admin state=directory -- file: path={{ mktemp.stdout }} state=directory - name: Store OpenShift Master credentials local_action: command /usr/bin/rsync --compress --archive --rsh 'ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' {{ mktemp.stdout }}/ root@{{ oo_public_ip }}:/var/lib/openshift/openshift.local.certificates/admin @@ -41,4 +40,4 @@ - name: Enable OpenShift service: name=openshift-node enabled=yes state=started -- file: name={{ mktemp.stdout }} state=absent +- local_action: file name={{ mktemp.stdout }} state=absent -- cgit v1.2.3 From 81db3db61f911cbbc6ff8f88b90cecb870c41381 Mon Sep 17 00:00:00 2001 From: Dan McPherson Date: Tue, 17 Feb 2015 19:58:58 -0500 Subject: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 98e87edbe..2aa0186f7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ openshift-online-ansible ======================== -This repo houses Ansible code used in OpenShift Online. +This repo contains OpenShift Ansible code. Setup ----- -- cgit v1.2.3 From b3507fa9b3e03f431c5de00a10137ddcf354593e Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Thu, 19 Feb 2015 15:30:26 -0500 Subject: Fixed an issue with the latest gce list. Correctly handles _meta --- lib/gce_command.rb | 12 +++++++++--- lib/gce_helper.rb | 32 +++++++++++++++++++++++++------- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/lib/gce_command.rb b/lib/gce_command.rb index b0a84d27b..b23834af5 100644 --- a/lib/gce_command.rb +++ b/lib/gce_command.rb @@ -120,14 +120,20 @@ module OpenShift ah.run_playbook("playbooks/gce/#{host_type}/terminate.yml") end + option :env, :required => false, :aliases => '-e', :enum => SUPPORTED_ENVS, + :desc => 'The environment to list.' desc "list", "Lists instances." def list() hosts = GceHelper.get_hosts() + hosts.delete_if { |h| h.env != options[:env] } unless options[:env].nil? + + fmt_str = "%34s %5s %8s %17s %7s" + puts - puts "Instances" - puts "---------" - hosts.each { |k| puts " #{k.name}" } + puts fmt_str % ['Name','Env', 'State', 'IP Address', 'Created By'] + puts fmt_str % ['----','---', '-----', '----------', '----------'] + hosts.each { |h| puts fmt_str % [h.name, h.env, h.state, h.public_ip, h.created_by ] } puts end diff --git a/lib/gce_helper.rb b/lib/gce_helper.rb index 2ff716ce1..19fa00020 100644 --- a/lib/gce_helper.rb +++ b/lib/gce_helper.rb @@ -5,23 +5,41 @@ module OpenShift class GceHelper MYDIR = File.expand_path(File.dirname(__FILE__)) - def self.get_hosts() + def self.get_list() cmd = "#{MYDIR}/../inventory/gce/gce.py --list" hosts = %x[#{cmd} 2>&1] raise "Error: failed to list hosts\n#{hosts}" unless $?.exitstatus == 0 - # invert the hash so that it's key is the host, and values is an array of metadata - data = {} - JSON.parse(hosts).each do |key,value| - value.each { |h| (data[h] ||= []) << key } + return JSON.parse(hosts) + end + + def self.get_tag(tags, selector) + tags.each do |tag| + return $1 if tag =~ selector end - # For now, we only care about the name. In the future, we may want the other metadata included. + return nil + end + + def self.get_hosts() + hosts = get_list() + retval = [] - data.keys.sort.each { |k| retval << OpenStruct.new({ :name => k }) } + hosts['_meta']['hostvars'].each do |host, info| + retval << OpenStruct.new({ + :name => info['gce_name'], + :env => get_tag(info['gce_tags'], /^env-(\w+)$/) || 'UNSET', + :public_ip => info['gce_public_ip'], + :state => info['gce_status'], + :created_by => get_tag(info['gce_tags'], /^created-by-(\w+)$/) || 'UNSET', + }) + end + + retval.sort_by! { |h| [h.env, h.state, h.name] } return retval + end def self.get_host_details(host) -- cgit v1.2.3 From a1b6d03c256ff0065cb7a8772533a1b2c81410e1 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Thu, 19 Feb 2015 14:52:33 -0700 Subject: Fix SSL support between master and node(s) --- roles/openshift_master/tasks/main.yml | 4 ++-- roles/openshift_node/tasks/main.yml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml index 9f28a3469..c92ca9c8f 100644 --- a/roles/openshift_master/tasks/main.yml +++ b/roles/openshift_master/tasks/main.yml @@ -24,10 +24,10 @@ firewalld: port=4001/tcp permanent=true state=enabled - name: Open firewalld port for OpenShift - firewalld: port=8080/tcp permanent=false state=enabled + firewalld: port=8443/tcp permanent=false state=enabled - name: Save firewalld port for OpenShift - firewalld: port=8080/tcp permanent=true state=enabled + firewalld: port=8443/tcp permanent=true state=enabled - name: Enable OpenShift service: name=openshift-master enabled=yes state=started diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml index e0041a90c..5d846fbe3 100644 --- a/roles/openshift_node/tasks/main.yml +++ b/roles/openshift_node/tasks/main.yml @@ -27,7 +27,7 @@ regexp: "{{ item.regex }}" line: "{{ item.line }}" with_items: - - { regex: '^OPTIONS=', line: 'OPTIONS=\"--master=http://{{ oo_master_ips[0] }}:8080 --loglevel=5\"' } + - { regex: '^OPTIONS=', line: 'OPTIONS=\"--master=https://{{ oo_master_ips[0] }}:8443 --loglevel=5\"' } notify: - restart openshift-node @@ -37,7 +37,8 @@ - name: Save firewalld port for OpenShift firewalld: port=10250/tcp permanent=true state=enabled + # Always bounce service to pick up new credentials - name: Enable OpenShift - service: name=openshift-node enabled=yes state=started + service: name=openshift-node enabled=yes state=restarted - local_action: file name={{ mktemp.stdout }} state=absent -- cgit v1.2.3 From 1932b8d007792e29c609099708224c6a4e29288e Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Fri, 20 Feb 2015 11:43:19 -0500 Subject: Set and export KUBECONFIG in root user .bash_profile - roles/base_os: Without this, the root user would need to manually configure this variable before attempting to run any osc commands - roles/base_os: Cleanup the firewall service definition and only pause when the service state changes. - roles/openshift_master: use Akram's suggestion of simplifying the firewall config - roles/openshift_master: explicitly disable previously exposed ports that are no longer exposed (8080/tcp I'm looking at you). --- roles/base_os/tasks/main.yaml | 23 ++++++++++++++--------- roles/openshift_master/tasks/main.yml | 25 ++++++++++++++----------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/roles/base_os/tasks/main.yaml b/roles/base_os/tasks/main.yaml index 01d2898c5..b18f5c40d 100644 --- a/roles/base_os/tasks/main.yaml +++ b/roles/base_os/tasks/main.yaml @@ -11,21 +11,26 @@ src: vimrc dest: /root/.vimrc -- name: Ensure vimrc is installed for user root - copy: - src: vimrc - dest: /root/.vimrc +- name: Add KUBECONFIG to .bash_profile for user root + lineinfile: + dest: /root/.bash_profile + regexp: "KUBECONFIG=" + line: "export KUBECONFIG={{ openshift_master_credentials_dir }}.kubeconfig" + state: present + insertafter: EOF - name: Install firewalld yum: pkg: firewalld state: installed -- name: enable firewalld service - command: /usr/bin/systemctl enable firewalld.service - -- name: start firewalld service - command: /usr/bin/systemctl start firewalld.service +- name: start and enable firewalld service + service: + name: firewalld + state: started + enabled: yes + register: result - name: need to pause here, otherwise the firewalld service starting can sometimes cause ssh to fail pause: seconds=10 + when: result | changed diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml index c92ca9c8f..96b889804 100644 --- a/roles/openshift_master/tasks/main.yml +++ b/roles/openshift_master/tasks/main.yml @@ -13,21 +13,24 @@ regexp: "{{ item.regex }}" line: "{{ item.line }}" with_items: - - { regex: '^OPTIONS=', line: 'OPTIONS=\"--public-master={{ oo_public_ip }} --nodes={{ oo_node_ips | join(",") }} --loglevel=5\"' } + - { regex: '^OPTIONS=', line: "OPTIONS=\"--public-master={{ oo_public_ip }} --nodes={{ oo_node_ips | join(",") }} --loglevel=5\"" } notify: - restart openshift-master -- name: Open firewalld port for etcd embedded in OpenShift - firewalld: port=4001/tcp permanent=false state=enabled +# Open etcd embedded, etcd embedded peer, openshift api, and +# openshift client ports +- name: Open firewalld ports for openshift-master + firewalld: port={{ item[0] }} permanent={{ item[1] }} state=enabled + with_nested: + - [ 4001/tcp, 7001/tcp, 8443/tcp, 8444/tcp ] + - [ true, false ] -- name: Save firewalld port for etcd embedded in - firewalld: port=4001/tcp permanent=true state=enabled - -- name: Open firewalld port for OpenShift - firewalld: port=8443/tcp permanent=false state=enabled - -- name: Save firewalld port for OpenShift - firewalld: port=8443/tcp permanent=true state=enabled +# Disable previously exposed ports that are no longer needed +- name: Close firewalld ports for openshift-master that are no longer needed + firewalld: port={{ item[0] }} permanent={{ item[1] }} state=enabled + with_nested: + - [ 8080/tcp ] + - [ true, false ] - name: Enable OpenShift service: name=openshift-master enabled=yes state=started -- cgit v1.2.3 From a22471f1e1f4fe84340976d40d02ea13bf801441 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Fri, 20 Feb 2015 12:55:33 -0500 Subject: Use the full path for the kubeconfig --- roles/base_os/tasks/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/base_os/tasks/main.yaml b/roles/base_os/tasks/main.yaml index b18f5c40d..2bb2b4ec7 100644 --- a/roles/base_os/tasks/main.yaml +++ b/roles/base_os/tasks/main.yaml @@ -15,7 +15,7 @@ lineinfile: dest: /root/.bash_profile regexp: "KUBECONFIG=" - line: "export KUBECONFIG={{ openshift_master_credentials_dir }}.kubeconfig" + line: "export KUBECONFIG=/var/lib/openshift/openshift.local.certificates/admin/.kubeconfig" state: present insertafter: EOF -- cgit v1.2.3 From dcd84a6c524c217432f4b529b66da165bf4ff3e9 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Fri, 20 Feb 2015 12:57:02 -0500 Subject: fix service definition for openshift-node --- roles/openshift_node/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml index 5d846fbe3..deff80a3d 100644 --- a/roles/openshift_node/tasks/main.yml +++ b/roles/openshift_node/tasks/main.yml @@ -39,6 +39,6 @@ # Always bounce service to pick up new credentials - name: Enable OpenShift - service: name=openshift-node enabled=yes state=restarted + service: name=openshift-node enabled=yes state=started - local_action: file name={{ mktemp.stdout }} state=absent -- cgit v1.2.3 From fd4d628907438ecb6372590d7ed67016b9e00de1 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Thu, 19 Feb 2015 14:52:33 -0700 Subject: Fix SSL support between master and node(s) --- playbooks/gce/openshift-node/launch.yml | 10 ++++++++++ roles/openshift_node/tasks/main.yml | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/playbooks/gce/openshift-node/launch.yml b/playbooks/gce/openshift-node/launch.yml index f2800b061..935599efd 100644 --- a/playbooks/gce/openshift-node/launch.yml +++ b/playbooks/gce/openshift-node/launch.yml @@ -45,3 +45,13 @@ # Apply the configs, separate so that just the configs can be run by themselves - include: config.yml + +# Always bounce service to pick up new credentials +#- name: "Restart instances" +# hosts: oo_hosts_to_config +# connection: ssh +# user: root +# tasks: +# - debug: var=groups.oo_hosts_to_config +# - name: Restart OpenShift +# service: name=openshift-node enabled=yes state=restarted diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml index deff80a3d..8a0694905 100644 --- a/roles/openshift_node/tasks/main.yml +++ b/roles/openshift_node/tasks/main.yml @@ -37,8 +37,9 @@ - name: Save firewalld port for OpenShift firewalld: port=10250/tcp permanent=true state=enabled + # fixme: Once the openshift_cluster playbook is published state should be started # Always bounce service to pick up new credentials - name: Enable OpenShift - service: name=openshift-node enabled=yes state=started + service: name=openshift-node enabled=yes state=restarted - local_action: file name={{ mktemp.stdout }} state=absent -- cgit v1.2.3 From 12ec90897f890e1f5ee417d9f6f56baa359f0313 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Fri, 20 Feb 2015 23:52:21 -0500 Subject: Repo role refactor to add enterprise support - Add openshift_additional_repos config that allows for setting custom repos - cleanup yum repos that were configured for other deployment types --- roles/repos/defaults/main.yaml | 5 ++ roles/repos/files/RPM-GPG-KEY-redhat-release | 63 ---------------------- roles/repos/files/epel7-kubernetes.repo | 6 --- roles/repos/files/epel7-openshift.repo | 6 --- roles/repos/files/online/RPM-GPG-KEY-redhat-beta | 61 +++++++++++++++++++++ .../repos/files/online/RPM-GPG-KEY-redhat-release | 63 ++++++++++++++++++++++ roles/repos/files/online/epel7-kubernetes.repo | 6 +++ roles/repos/files/online/epel7-openshift.repo | 6 +++ .../repos/files/online/oso-rhui-rhel-7-extras.repo | 23 ++++++++ .../repos/files/online/oso-rhui-rhel-7-server.repo | 21 ++++++++ .../repos/files/online/rhel-7-libra-candidate.repo | 11 ++++ roles/repos/files/oso-rhui-rhel-7-extras.repo | 23 -------- roles/repos/files/oso-rhui-rhel-7-server.repo | 21 -------- roles/repos/files/rhel-7-libra-candidate.repo | 11 ---- roles/repos/tasks/main.yaml | 47 ++++++++++++---- roles/repos/templates/yum_repo.j2 | 15 ++++++ roles/repos/vars/main.yml | 2 + 17 files changed, 249 insertions(+), 141 deletions(-) create mode 100644 roles/repos/defaults/main.yaml delete mode 100644 roles/repos/files/RPM-GPG-KEY-redhat-release delete mode 100644 roles/repos/files/epel7-kubernetes.repo delete mode 100644 roles/repos/files/epel7-openshift.repo create mode 100644 roles/repos/files/online/RPM-GPG-KEY-redhat-beta create mode 100644 roles/repos/files/online/RPM-GPG-KEY-redhat-release create mode 100644 roles/repos/files/online/epel7-kubernetes.repo create mode 100644 roles/repos/files/online/epel7-openshift.repo create mode 100644 roles/repos/files/online/oso-rhui-rhel-7-extras.repo create mode 100644 roles/repos/files/online/oso-rhui-rhel-7-server.repo create mode 100644 roles/repos/files/online/rhel-7-libra-candidate.repo delete mode 100644 roles/repos/files/oso-rhui-rhel-7-extras.repo delete mode 100644 roles/repos/files/oso-rhui-rhel-7-server.repo delete mode 100644 roles/repos/files/rhel-7-libra-candidate.repo create mode 100644 roles/repos/templates/yum_repo.j2 create mode 100644 roles/repos/vars/main.yml diff --git a/roles/repos/defaults/main.yaml b/roles/repos/defaults/main.yaml new file mode 100644 index 000000000..6fe2bf621 --- /dev/null +++ b/roles/repos/defaults/main.yaml @@ -0,0 +1,5 @@ +--- +# TODO: once we are able to configure/deploy origin using the openshift roles, +# then we should default to origin +openshift_deployment_type: online +openshift_additional_repos: {} diff --git a/roles/repos/files/RPM-GPG-KEY-redhat-release b/roles/repos/files/RPM-GPG-KEY-redhat-release deleted file mode 100644 index 0f83b622d..000000000 --- a/roles/repos/files/RPM-GPG-KEY-redhat-release +++ /dev/null @@ -1,63 +0,0 @@ -The following public key can be used to verify RPM packages built and -signed by Red Hat, Inc. This key is used for packages in Red Hat -products shipped after November 2009, and for all updates to those -products. - -Questions about this key should be sent to security@redhat.com. - -pub 4096R/FD431D51 2009-10-22 Red Hat, Inc. (release key 2) - ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.2.6 (GNU/Linux) - -mQINBErgSTsBEACh2A4b0O9t+vzC9VrVtL1AKvUWi9OPCjkvR7Xd8DtJxeeMZ5eF -0HtzIG58qDRybwUe89FZprB1ffuUKzdE+HcL3FbNWSSOXVjZIersdXyH3NvnLLLF -0DNRB2ix3bXG9Rh/RXpFsNxDp2CEMdUvbYCzE79K1EnUTVh1L0Of023FtPSZXX0c -u7Pb5DI5lX5YeoXO6RoodrIGYJsVBQWnrWw4xNTconUfNPk0EGZtEnzvH2zyPoJh -XGF+Ncu9XwbalnYde10OCvSWAZ5zTCpoLMTvQjWpbCdWXJzCm6G+/hx9upke546H -5IjtYm4dTIVTnc3wvDiODgBKRzOl9rEOCIgOuGtDxRxcQkjrC+xvg5Vkqn7vBUyW -9pHedOU+PoF3DGOM+dqv+eNKBvh9YF9ugFAQBkcG7viZgvGEMGGUpzNgN7XnS1gj -/DPo9mZESOYnKceve2tIC87p2hqjrxOHuI7fkZYeNIcAoa83rBltFXaBDYhWAKS1 -PcXS1/7JzP0ky7d0L6Xbu/If5kqWQpKwUInXtySRkuraVfuK3Bpa+X1XecWi24JY -HVtlNX025xx1ewVzGNCTlWn1skQN2OOoQTV4C8/qFpTW6DTWYurd4+fE0OJFJZQF -buhfXYwmRlVOgN5i77NTIJZJQfYFj38c/Iv5vZBPokO6mffrOTv3MHWVgQARAQAB -tDNSZWQgSGF0LCBJbmMuIChyZWxlYXNlIGtleSAyKSA8c2VjdXJpdHlAcmVkaGF0 -LmNvbT6JAjYEEwECACAFAkrgSTsCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAK -CRAZni+R/UMdUWzpD/9s5SFR/ZF3yjY5VLUFLMXIKUztNN3oc45fyLdTI3+UClKC -2tEruzYjqNHhqAEXa2sN1fMrsuKec61Ll2NfvJjkLKDvgVIh7kM7aslNYVOP6BTf -C/JJ7/ufz3UZmyViH/WDl+AYdgk3JqCIO5w5ryrC9IyBzYv2m0HqYbWfphY3uHw5 -un3ndLJcu8+BGP5F+ONQEGl+DRH58Il9Jp3HwbRa7dvkPgEhfFR+1hI+Btta2C7E -0/2NKzCxZw7Lx3PBRcU92YKyaEihfy/aQKZCAuyfKiMvsmzs+4poIX7I9NQCJpyE -IGfINoZ7VxqHwRn/d5mw2MZTJjbzSf+Um9YJyA0iEEyD6qjriWQRbuxpQXmlAJbh -8okZ4gbVFv1F8MzK+4R8VvWJ0XxgtikSo72fHjwha7MAjqFnOq6eo6fEC/75g3NL -Ght5VdpGuHk0vbdENHMC8wS99e5qXGNDued3hlTavDMlEAHl34q2H9nakTGRF5Ki -JUfNh3DVRGhg8cMIti21njiRh7gyFI2OccATY7bBSr79JhuNwelHuxLrCFpY7V25 -OFktl15jZJaMxuQBqYdBgSay2G0U6D1+7VsWufpzd/Abx1/c3oi9ZaJvW22kAggq -dzdA27UUYjWvx42w9menJwh/0jeQcTecIUd0d0rFcw/c1pvgMMl/Q73yzKgKYw== -=zbHE ------END PGP PUBLIC KEY BLOCK----- -The following public key can be used to verify RPM packages built and -signed by Red Hat, Inc. This key is a supporting (auxiliary) key for -Red Hat products shipped after November 2006 and for all updates to -those products. - -Questions about this key should be sent to security@redhat.com. - ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.2.6 (GNU/Linux) - -mQGiBEVwDGkRBACwPhZIpvkjI8wV9sFTDoqyPLx1ub8Sd/w+YuI5Ovm49mvvEQVT -VLg8FgE5JlST59AbsLDyVtRa9CxIvN5syBVrWWWtHtDnnylFBcqG/A6J3bI4E9/A -UtSL5Zxbav0+utP6f3wOpxQrxc+WIDVgpurdBKAQ3dsobGBqypeX6FXZ5wCgou6C -yZpGIBqosJaDWLzNeOfb/70D/1thLkQyhW3JJ6cHCYJHNfBShvbLWBf6S231mgmu -MyMlt8Kmipc9bw+saaAkSkVsQ/ZbfjrWB7e5kbMruKLVrH+nGhamlHYUGyAPtsPg -Uj/NUSj5BmrCsOkMpn43ngTLssE9MLhSPj2nIHGFv9B+iVLvomDdwnaBRgQ1aK8z -z6MAA/406yf5yVJ/MlTWs1/68VwDhosc9BtU1V5IE0NXgZUAfBJzzfVzzKQq6zJ2 -eZsMLhr96wbsW13zUZt1ing+ulwh2ee4meuJq6h/971JspFY/XBhcfq4qCNqVjsq -SZnWoGdCO6J8CxPIemD2IUHzjoyyeEj3RVydup6pcWZAmhzkKrQzUmVkIEhhdCwg -SW5jLiAoYXV4aWxpYXJ5IGtleSkgPHNlY3VyaXR5QHJlZGhhdC5jb20+iF4EExEC -AB4FAkVwDGkCGwMGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQRWiciC+mWOC1rQCg -ooNLCFOzNPcvhd9Za8C801HmnsYAniCw3yzrCqtjYnxDDxlufH0FVTwX -=d/bm ------END PGP PUBLIC KEY BLOCK----- - diff --git a/roles/repos/files/epel7-kubernetes.repo b/roles/repos/files/epel7-kubernetes.repo deleted file mode 100644 index 1deae2939..000000000 --- a/roles/repos/files/epel7-kubernetes.repo +++ /dev/null @@ -1,6 +0,0 @@ -[maxamillion-epel7-kubernetes] -name=Copr repo for epel7-kubernetes owned by maxamillion -baseurl=http://copr-be.cloud.fedoraproject.org/results/maxamillion/epel7-kubernetes/epel-7-$basearch/ -skip_if_unavailable=True -gpgcheck=0 -enabled=1 diff --git a/roles/repos/files/epel7-openshift.repo b/roles/repos/files/epel7-openshift.repo deleted file mode 100644 index c7629872d..000000000 --- a/roles/repos/files/epel7-openshift.repo +++ /dev/null @@ -1,6 +0,0 @@ -[maxamillion-origin-next] -name=Copr repo for origin-next owned by maxamillion -baseurl=http://copr-be.cloud.fedoraproject.org/results/maxamillion/origin-next/epel-7-$basearch/ -skip_if_unavailable=False -gpgcheck=0 -enabled=1 diff --git a/roles/repos/files/online/RPM-GPG-KEY-redhat-beta b/roles/repos/files/online/RPM-GPG-KEY-redhat-beta new file mode 100644 index 000000000..7b40671a4 --- /dev/null +++ b/roles/repos/files/online/RPM-GPG-KEY-redhat-beta @@ -0,0 +1,61 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.2.6 (GNU/Linux) + +mQINBEmkAzABEAC2/c7bP1lHQ3XScxbIk0LQWe1YOiibQBRLwf8Si5PktgtuPibT +kKpZjw8p4D+fM7jD1WUzUE0X7tXg2l/eUlMM4dw6XJAQ1AmEOtlwSg7rrMtTvM0A +BEtI7Km6fC6sU6RtBMdcqD1cH/6dbsfh8muznVA7UlX+PRBHVzdWzj6y8h84dBjo +gzcbYu9Hezqgj/lLzicqsSZPz9UdXiRTRAIhp8V30BD8uRaaa0KDDnD6IzJv3D9P +xQWbFM4Z12GN9LyeZqmD7bpKzZmXG/3drvfXVisXaXp3M07t3NlBa3Dt8NFIKZ0D +FRXBz5bvzxRVmdH6DtkDWXDPOt+Wdm1rZrCOrySFpBZQRpHw12eo1M1lirANIov7 +Z+V1Qh/aBxj5EUu32u9ZpjAPPNtQF6F/KjaoHHHmEQAuj4DLex4LY646Hv1rcv2i +QFuCdvLKQGSiFBrfZH0j/IX3/0JXQlZzb3MuMFPxLXGAoAV9UP/Sw/WTmAuTzFVm +G13UYFeMwrToOiqcX2VcK0aC1FCcTP2z4JW3PsWvU8rUDRUYfoXovc7eg4Vn5wHt +0NBYsNhYiAAf320AUIHzQZYi38JgVwuJfFu43tJZE4Vig++RQq6tsEx9Ftz3EwRR +fJ9z9mEvEiieZm+vbOvMvIuimFVPSCmLH+bI649K8eZlVRWsx3EXCVb0nQARAQAB +tDBSZWQgSGF0LCBJbmMuIChiZXRhIGtleSAyKSA8c2VjdXJpdHlAcmVkaGF0LmNv +bT6JAjYEEwECACAFAkpSM+cCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRCT +ioDK8hVB6/9tEAC0+KmzeKceXQ/GTUoU6jy9vtkFCFrmv+c7ol4XpdTt0QhqBOwy +6m2mKWwmm8KfYfy0cADQ4y/EcoXl7FtFBwYmkCuEQGXhTDn9DvVjhooIq59LEMBQ +OW879RwwzRIZ8ebbjMUjDPF5MfPQqP2LBu9N4KvXlZp4voykwuuaJ+cbsKZR6pZ6 +0RQKPHKP+NgUFC0fff7XY9cuOZZWFAeKRhLN2K7bnRHKxp+kELWb6R9ZfrYwZjWc +MIPbTd1khE53L4NTfpWfAnJRtkPSDOKEGVlVLtLq4HEAxQt07kbslqISRWyXER3u +QOJj64D1ZiIMz6t6uZ424VE4ry9rBR0Jz55cMMx5O/ni9x3xzFUgH8Su2yM0r3jE +Rf24+tbOaPf7tebyx4OKe+JW95hNVstWUDyGbs6K9qGfI/pICuO1nMMFTo6GqzQ6 +DwLZvJ9QdXo7ujEtySZnfu42aycaQ9ZLC2DOCQCUBY350Hx6FLW3O546TAvpTfk0 +B6x+DV7mJQH7MGmRXQsE7TLBJKjq28Cn4tVp04PmybQyTxZdGA/8zY6pPl6xyVMH +V68hSBKEVT/rlouOHuxfdmZva1DhVvUC6Xj7+iTMTVJUAq/4Uyn31P1OJmA2a0PT +CAqWkbJSgKFccsjPoTbLyxhuMSNkEZFHvlZrSK9vnPzmfiRH0Orx3wYpMQ== +=21pb +-----END PGP PUBLIC KEY BLOCK----- +The following public key can be used to verify RPM packages built and +signed by Red Hat, Inc. for this beta using `rpm -K' using the GNU GPG +package. Questions about this key should be sent to security@redhat.com. + + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.0.6 (GNU/Linux) +Comment: For info see http://www.gnupg.org + +mQGiBDySTqsRBACzc7xuCIp10oj5B2PAV4XzDeVxprv/WTMreSNSK+iC0bEz0IBp +Vnn++qtyiXfH+bGIE9jqZgIEnpttWhUOaU5LhcLFzy+m8NWfngIFP9QfGmGAe9Gd +LFeAdhj4RmSG/vgr7vDd83Hz22dv403Ar/sliWO4vDOrMmZBG57WGYTWtwCgkMsi +UUQuJ6slbzKn82w+bYxOlL0EAIylWJGaTkKOTL5DqVR3ik9aT0Dt3FNVYiuhcKBe +II4E3KOIVA9kO8in1IZjx2gs6K2UV+GsoAVANdfKL7l9O+k+J8OxhE74oycvYJxW +QzCgXMZkNcvW5wyXwEMcr6TVd/5BGztcMw8oT3/l2MtAEG/vn1XaWToRSO1XDMDz ++AjUA/4m0mTkN8S4wjzJG8lqN7+quW3UOaiCe8J3SFrrrhE0XbY9cTJI/9nuXHU1 +VjqOSmXQYH2Db7UOroFTBiWhlAedA4O4yuK52AJnvSsHbnJSEmn9rpo5z1Q8F+qI +mDlzriJdrIrVLeDiUeTlpH3kpG38D7007GhXBV72k1gpMoMcpbQ3UmVkIEhhdCwg +SW5jLiAoQmV0YSBUZXN0IFNvZnR3YXJlKSA8cmF3aGlkZUByZWRoYXQuY29tPohX +BBMRAgAXBQI8l5p/BQsHCgMEAxUDAgMWAgECF4AACgkQ/TcmiYl9oHqdeQCfZjw4 +F9sir3XfRAjVe9kYNcQ8hnIAn0WgyT7H5RriWYTOCfauOmd+cAW4iEYEEBECAAYF +AjyXmqQACgkQIZGAzdtCpg5nDQCfepuRUyuVJvhuQkPWySETYvRw+WoAnjAWhx6q +0npMx4OE1JGFi8ymKXktuQENBDySTq4QBADKL/mK7S8E3synxISlu7R6fUvu07Oc +RoX96n0Di6T+BS99hC44XzHjMDhUX2ZzVvYS88EZXoUDDkB/8g7SwZrOJ/QE1zrI +JmSVciNhSYWwqeT40Evs88ajZUfDiNbS/cSC6oui98iS4vxd7sE7IPY+FSx9vuAR +xOa9vBnJY/dx0wADBQQAosm+Iltt2uigC6LJzxNOoIdB5r0GqTC1o5sHCeNqXJhU +ExAG8m74uzMlYVLOpGZi4y4NwwAWvCWC0MWWnnu+LGFy1wKiJKRjhv5F+WkFutY5 +WHV5L44vp9jSIlBCRG+84jheTh8xqhndM9wOfPwWdYYu1vxrB8Tn6kA17PcYfHSI +RgQYEQIABgUCPJJergAKCRD9NyaJiX2geiCPAJ4nEM4NtI9Uj8lONDk6FU86PmoL +yACfb68fBd2pWEzLKsOk9imIobHHpzE= +=gpIn +-----END PGP PUBLIC KEY BLOCK----- diff --git a/roles/repos/files/online/RPM-GPG-KEY-redhat-release b/roles/repos/files/online/RPM-GPG-KEY-redhat-release new file mode 100644 index 000000000..0f83b622d --- /dev/null +++ b/roles/repos/files/online/RPM-GPG-KEY-redhat-release @@ -0,0 +1,63 @@ +The following public key can be used to verify RPM packages built and +signed by Red Hat, Inc. This key is used for packages in Red Hat +products shipped after November 2009, and for all updates to those +products. + +Questions about this key should be sent to security@redhat.com. + +pub 4096R/FD431D51 2009-10-22 Red Hat, Inc. (release key 2) + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.2.6 (GNU/Linux) + +mQINBErgSTsBEACh2A4b0O9t+vzC9VrVtL1AKvUWi9OPCjkvR7Xd8DtJxeeMZ5eF +0HtzIG58qDRybwUe89FZprB1ffuUKzdE+HcL3FbNWSSOXVjZIersdXyH3NvnLLLF +0DNRB2ix3bXG9Rh/RXpFsNxDp2CEMdUvbYCzE79K1EnUTVh1L0Of023FtPSZXX0c +u7Pb5DI5lX5YeoXO6RoodrIGYJsVBQWnrWw4xNTconUfNPk0EGZtEnzvH2zyPoJh +XGF+Ncu9XwbalnYde10OCvSWAZ5zTCpoLMTvQjWpbCdWXJzCm6G+/hx9upke546H +5IjtYm4dTIVTnc3wvDiODgBKRzOl9rEOCIgOuGtDxRxcQkjrC+xvg5Vkqn7vBUyW +9pHedOU+PoF3DGOM+dqv+eNKBvh9YF9ugFAQBkcG7viZgvGEMGGUpzNgN7XnS1gj +/DPo9mZESOYnKceve2tIC87p2hqjrxOHuI7fkZYeNIcAoa83rBltFXaBDYhWAKS1 +PcXS1/7JzP0ky7d0L6Xbu/If5kqWQpKwUInXtySRkuraVfuK3Bpa+X1XecWi24JY +HVtlNX025xx1ewVzGNCTlWn1skQN2OOoQTV4C8/qFpTW6DTWYurd4+fE0OJFJZQF +buhfXYwmRlVOgN5i77NTIJZJQfYFj38c/Iv5vZBPokO6mffrOTv3MHWVgQARAQAB +tDNSZWQgSGF0LCBJbmMuIChyZWxlYXNlIGtleSAyKSA8c2VjdXJpdHlAcmVkaGF0 +LmNvbT6JAjYEEwECACAFAkrgSTsCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAK +CRAZni+R/UMdUWzpD/9s5SFR/ZF3yjY5VLUFLMXIKUztNN3oc45fyLdTI3+UClKC +2tEruzYjqNHhqAEXa2sN1fMrsuKec61Ll2NfvJjkLKDvgVIh7kM7aslNYVOP6BTf +C/JJ7/ufz3UZmyViH/WDl+AYdgk3JqCIO5w5ryrC9IyBzYv2m0HqYbWfphY3uHw5 +un3ndLJcu8+BGP5F+ONQEGl+DRH58Il9Jp3HwbRa7dvkPgEhfFR+1hI+Btta2C7E +0/2NKzCxZw7Lx3PBRcU92YKyaEihfy/aQKZCAuyfKiMvsmzs+4poIX7I9NQCJpyE +IGfINoZ7VxqHwRn/d5mw2MZTJjbzSf+Um9YJyA0iEEyD6qjriWQRbuxpQXmlAJbh +8okZ4gbVFv1F8MzK+4R8VvWJ0XxgtikSo72fHjwha7MAjqFnOq6eo6fEC/75g3NL +Ght5VdpGuHk0vbdENHMC8wS99e5qXGNDued3hlTavDMlEAHl34q2H9nakTGRF5Ki +JUfNh3DVRGhg8cMIti21njiRh7gyFI2OccATY7bBSr79JhuNwelHuxLrCFpY7V25 +OFktl15jZJaMxuQBqYdBgSay2G0U6D1+7VsWufpzd/Abx1/c3oi9ZaJvW22kAggq +dzdA27UUYjWvx42w9menJwh/0jeQcTecIUd0d0rFcw/c1pvgMMl/Q73yzKgKYw== +=zbHE +-----END PGP PUBLIC KEY BLOCK----- +The following public key can be used to verify RPM packages built and +signed by Red Hat, Inc. This key is a supporting (auxiliary) key for +Red Hat products shipped after November 2006 and for all updates to +those products. + +Questions about this key should be sent to security@redhat.com. + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.2.6 (GNU/Linux) + +mQGiBEVwDGkRBACwPhZIpvkjI8wV9sFTDoqyPLx1ub8Sd/w+YuI5Ovm49mvvEQVT +VLg8FgE5JlST59AbsLDyVtRa9CxIvN5syBVrWWWtHtDnnylFBcqG/A6J3bI4E9/A +UtSL5Zxbav0+utP6f3wOpxQrxc+WIDVgpurdBKAQ3dsobGBqypeX6FXZ5wCgou6C +yZpGIBqosJaDWLzNeOfb/70D/1thLkQyhW3JJ6cHCYJHNfBShvbLWBf6S231mgmu +MyMlt8Kmipc9bw+saaAkSkVsQ/ZbfjrWB7e5kbMruKLVrH+nGhamlHYUGyAPtsPg +Uj/NUSj5BmrCsOkMpn43ngTLssE9MLhSPj2nIHGFv9B+iVLvomDdwnaBRgQ1aK8z +z6MAA/406yf5yVJ/MlTWs1/68VwDhosc9BtU1V5IE0NXgZUAfBJzzfVzzKQq6zJ2 +eZsMLhr96wbsW13zUZt1ing+ulwh2ee4meuJq6h/971JspFY/XBhcfq4qCNqVjsq +SZnWoGdCO6J8CxPIemD2IUHzjoyyeEj3RVydup6pcWZAmhzkKrQzUmVkIEhhdCwg +SW5jLiAoYXV4aWxpYXJ5IGtleSkgPHNlY3VyaXR5QHJlZGhhdC5jb20+iF4EExEC +AB4FAkVwDGkCGwMGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQRWiciC+mWOC1rQCg +ooNLCFOzNPcvhd9Za8C801HmnsYAniCw3yzrCqtjYnxDDxlufH0FVTwX +=d/bm +-----END PGP PUBLIC KEY BLOCK----- + diff --git a/roles/repos/files/online/epel7-kubernetes.repo b/roles/repos/files/online/epel7-kubernetes.repo new file mode 100644 index 000000000..1deae2939 --- /dev/null +++ b/roles/repos/files/online/epel7-kubernetes.repo @@ -0,0 +1,6 @@ +[maxamillion-epel7-kubernetes] +name=Copr repo for epel7-kubernetes owned by maxamillion +baseurl=http://copr-be.cloud.fedoraproject.org/results/maxamillion/epel7-kubernetes/epel-7-$basearch/ +skip_if_unavailable=True +gpgcheck=0 +enabled=1 diff --git a/roles/repos/files/online/epel7-openshift.repo b/roles/repos/files/online/epel7-openshift.repo new file mode 100644 index 000000000..c7629872d --- /dev/null +++ b/roles/repos/files/online/epel7-openshift.repo @@ -0,0 +1,6 @@ +[maxamillion-origin-next] +name=Copr repo for origin-next owned by maxamillion +baseurl=http://copr-be.cloud.fedoraproject.org/results/maxamillion/origin-next/epel-7-$basearch/ +skip_if_unavailable=False +gpgcheck=0 +enabled=1 diff --git a/roles/repos/files/online/oso-rhui-rhel-7-extras.repo b/roles/repos/files/online/oso-rhui-rhel-7-extras.repo new file mode 100644 index 000000000..cfe41f691 --- /dev/null +++ b/roles/repos/files/online/oso-rhui-rhel-7-extras.repo @@ -0,0 +1,23 @@ +[oso-rhui-rhel-server-extras] +name=OpenShift Online RHUI Mirror RH Enterprise Linux - Extras +baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhui-rhel-server-7-extras/ + https://mirror.ops.rhcloud.com/libra/rhui-rhel-server-7-extras/ +enabled=1 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta +failovermethod=priority +sslverify=False +sslclientcert=/var/lib/yum/client-cert.pem +sslclientkey=/var/lib/yum/client-key.pem + +[oso-rhui-rhel-server-extras-htb] +name=OpenShift Online RHUI Mirror RH Enterprise Linux - Extras HTB +baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhui-rhel-server-7-extras-htb/ + https://mirror.ops.rhcloud.com/libra/rhui-rhel-server-7-extras-htb/ +enabled=0 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta +failovermethod=priority +sslverify=False +sslclientcert=/var/lib/yum/client-cert.pem +sslclientkey=/var/lib/yum/client-key.pem diff --git a/roles/repos/files/online/oso-rhui-rhel-7-server.repo b/roles/repos/files/online/oso-rhui-rhel-7-server.repo new file mode 100644 index 000000000..ddc93193d --- /dev/null +++ b/roles/repos/files/online/oso-rhui-rhel-7-server.repo @@ -0,0 +1,21 @@ +[oso-rhui-rhel-server-releases] +name=OpenShift Online RHUI Mirror RH Enterprise Linux 7 +baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhui-rhel-server-7-releases/ + https://mirror.ops.rhcloud.com/libra/rhui-rhel-server-7-releases/ +enabled=1 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +sslverify=False +sslclientcert=/var/lib/yum/client-cert.pem +sslclientkey=/var/lib/yum/client-key.pem + +[oso-rhui-rhel-server-releases-optional] +name=OpenShift Online RHUI Mirror RH Enterprise Linux 7 - Optional +baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhui-rhel-server-7-releases-optional/ + https://mirror.ops.rhcloud.com/libra/rhui-rhel-server-7-releases-optional/ +enabled=1 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +sslverify=False +sslclientcert=/var/lib/yum/client-cert.pem +sslclientkey=/var/lib/yum/client-key.pem diff --git a/roles/repos/files/online/rhel-7-libra-candidate.repo b/roles/repos/files/online/rhel-7-libra-candidate.repo new file mode 100644 index 000000000..b4215679f --- /dev/null +++ b/roles/repos/files/online/rhel-7-libra-candidate.repo @@ -0,0 +1,11 @@ +[rhel-7-libra-candidate] +name=rhel-7-libra-candidate - \$basearch +baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhel-7-libra-candidate/\$basearch/ + https://mirror.ops.rhcloud.com/libra/rhel-7-libra-candidate/\$basearch/ +gpgkey=https://mirror.ops.rhcloud.com/libra/RPM-GPG-KEY-redhat-openshifthosted +skip_if_unavailable=True +gpgcheck=0 +enabled=1 +sslclientcert=/var/lib/yum/client-cert.pem +sslclientkey=/var/lib/yum/client-key.pem +sslverify=False diff --git a/roles/repos/files/oso-rhui-rhel-7-extras.repo b/roles/repos/files/oso-rhui-rhel-7-extras.repo deleted file mode 100644 index cfe41f691..000000000 --- a/roles/repos/files/oso-rhui-rhel-7-extras.repo +++ /dev/null @@ -1,23 +0,0 @@ -[oso-rhui-rhel-server-extras] -name=OpenShift Online RHUI Mirror RH Enterprise Linux - Extras -baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhui-rhel-server-7-extras/ - https://mirror.ops.rhcloud.com/libra/rhui-rhel-server-7-extras/ -enabled=1 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta -failovermethod=priority -sslverify=False -sslclientcert=/var/lib/yum/client-cert.pem -sslclientkey=/var/lib/yum/client-key.pem - -[oso-rhui-rhel-server-extras-htb] -name=OpenShift Online RHUI Mirror RH Enterprise Linux - Extras HTB -baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhui-rhel-server-7-extras-htb/ - https://mirror.ops.rhcloud.com/libra/rhui-rhel-server-7-extras-htb/ -enabled=0 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta -failovermethod=priority -sslverify=False -sslclientcert=/var/lib/yum/client-cert.pem -sslclientkey=/var/lib/yum/client-key.pem diff --git a/roles/repos/files/oso-rhui-rhel-7-server.repo b/roles/repos/files/oso-rhui-rhel-7-server.repo deleted file mode 100644 index 9fe4d6623..000000000 --- a/roles/repos/files/oso-rhui-rhel-7-server.repo +++ /dev/null @@ -1,21 +0,0 @@ -[oso-rhui-rhel-server-releases] -name=OpenShift Online RHUI Mirror RH Enterprise Linux 7 -baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhui-rhel-server-7-releases/ - https://mirror.ops.rhcloud.com/libra/rhui-rhel-server-7-releases/ -enabled=1 -gpgcheck=1 -gpgkey=file:///srv/libra/keys/RPM-GPG-KEY-redhat-release -sslverify=False -sslclientcert=/var/lib/yum/client-cert.pem -sslclientkey=/var/lib/yum/client-key.pem - -[oso-rhui-rhel-server-releases-optional] -name=OpenShift Online RHUI Mirror RH Enterprise Linux 7 - Optional -baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhui-rhel-server-7-releases-optional/ - https://mirror.ops.rhcloud.com/libra/rhui-rhel-server-7-releases-optional/ -enabled=1 -gpgcheck=1 -gpgkey=file:///srv/libra/keys/RPM-GPG-KEY-redhat-release -sslverify=False -sslclientcert=/var/lib/yum/client-cert.pem -sslclientkey=/var/lib/yum/client-key.pem diff --git a/roles/repos/files/rhel-7-libra-candidate.repo b/roles/repos/files/rhel-7-libra-candidate.repo deleted file mode 100644 index b4215679f..000000000 --- a/roles/repos/files/rhel-7-libra-candidate.repo +++ /dev/null @@ -1,11 +0,0 @@ -[rhel-7-libra-candidate] -name=rhel-7-libra-candidate - \$basearch -baseurl=https://gce-mirror1.ops.rhcloud.com/libra/rhel-7-libra-candidate/\$basearch/ - https://mirror.ops.rhcloud.com/libra/rhel-7-libra-candidate/\$basearch/ -gpgkey=https://mirror.ops.rhcloud.com/libra/RPM-GPG-KEY-redhat-openshifthosted -skip_if_unavailable=True -gpgcheck=0 -enabled=1 -sslclientcert=/var/lib/yum/client-cert.pem -sslclientkey=/var/lib/yum/client-key.pem -sslverify=False diff --git a/roles/repos/tasks/main.yaml b/roles/repos/tasks/main.yaml index a6a80581e..43786da41 100644 --- a/roles/repos/tasks/main.yaml +++ b/roles/repos/tasks/main.yaml @@ -1,16 +1,41 @@ --- -# The following role lays down the correct repository and gpg key for yum -- name: Ensure rhel 7 libra candidate exists in yum.repos.d - copy: src=rhel-7-libra-candidate.repo dest=/etc/yum.repos.d/rhel-7-libra-candidate.repo +# TODO: Add flag for enabling EPEL repo, default to false -- name: Ensure rhel 7 extras exists in yum.repos.d - copy: src=oso-rhui-rhel-7-extras.repo dest=/etc/yum.repos.d/oso-rhui-rhel-7-extras.repo +- assert: + that: openshift_deployment_type in known_openshift_deployment_types -- name: Ensure the kubernetes repo is available - copy: src=epel7-kubernetes.repo dest=/etc/yum.repos.d/epel7-kubernetes.repo +# TODO: remove this when origin support actually works +- fail: msg="OpenShift Origin support is not currently enabled" + when: openshift_deployment_type == 'origin' -- name: Ensure the origin repo is available - copy: src=epel7-openshift.repo dest=/etc/yum.repos.d/epel7-openshift.repo +- name: Create any additional repos that are defined + template: + src: yum_repo.j2 + dest: /etc/yum.repos.d/openshift_additional.repo + when: openshift_additional_repos | length > 0 -- name: Ensure the rhel repo is available - copy: src=oso-rhui-rhel-7-server.repo dest=/etc/yum.repos.d/oso-rhui-rhel-7-server.repo +- name: Remove the additional repos if no longer defined + file: + dest: /etc/yum.repos.d/openshift_additional.repo + state: absent + when: openshift_additional_repos | length == 0 + +- name: Remove any yum repo files for other deployment types + file: + path: "/etc/yum.repos.d/{{ item | basename }}" + state: absent + with_fileglob: + - '*/*' + when: not (item | search("/files/" + openshift_deployment_type + "/")) and (item | search(".repo$")) + +- name: Configure gpg keys if needed + copy: src={{ item }} dest=/etc/pki/rpm-gpg/ + with_fileglob: + - "{{ openshift_deployment_type }}/*" + when: item | basename | match("RPM-GPG-KEY-") + +- name: Configure yum repositories + copy: src={{ item }} dest=/etc/yum.repos.d/ + with_fileglob: + - "{{ openshift_deployment_type }}/*" + when: item | basename | search(".*\.repo$") diff --git a/roles/repos/templates/yum_repo.j2 b/roles/repos/templates/yum_repo.j2 new file mode 100644 index 000000000..7ea2c7460 --- /dev/null +++ b/roles/repos/templates/yum_repo.j2 @@ -0,0 +1,15 @@ +# {{ ansible_managed }} +{% for repo in openshift_additional_repos %} +[{{ repo.id }}] +name={{ repo.name | default(repo.id) }} +baseurl={{ repo.baseurl }} +{% set enable_repo = repo.enabled | default('1') %} +enabled={{ 1 if ( enable_repo == 1 or enable_repo == True ) else 0 }} +{% set enable_gpg_check = repo.gpgcheck | default('1') %} +gpgcheck={{ 1 if ( enable_gpg_check == 1 or enable_gpg_check == True ) else 0 }} +{% for key, value in repo.iteritems() %} +{% if key not in ['id', 'name', 'baseurl', 'enabled', 'gpgcheck'] and value is defined %} +{{ key }}={{ value }} +{% endif %} +{% endfor %} +{% endfor %} diff --git a/roles/repos/vars/main.yml b/roles/repos/vars/main.yml new file mode 100644 index 000000000..bbb4c77e7 --- /dev/null +++ b/roles/repos/vars/main.yml @@ -0,0 +1,2 @@ +--- +known_openshift_deployment_types: ['origin', 'online', 'enterprise'] -- cgit v1.2.3 From de2fa14b28bf34207dcc21b698cea441d6e918bc Mon Sep 17 00:00:00 2001 From: Thomas Wiest Date: Mon, 23 Feb 2015 15:44:06 -0500 Subject: fixed bug when updating the openshift-master sysconfig file. Also, made it multi-line so we get better errors from ansible. --- roles/openshift_master/tasks/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml index 96b889804..6f96a6cdb 100644 --- a/roles/openshift_master/tasks/main.yml +++ b/roles/openshift_master/tasks/main.yml @@ -13,7 +13,8 @@ regexp: "{{ item.regex }}" line: "{{ item.line }}" with_items: - - { regex: '^OPTIONS=', line: "OPTIONS=\"--public-master={{ oo_public_ip }} --nodes={{ oo_node_ips | join(",") }} --loglevel=5\"" } + - regex: '^OPTIONS=' + line: "OPTIONS=\"--public-master={{ oo_public_ip }} --nodes={{ oo_node_ips | join(',') }} --loglevel=5\"" notify: - restart openshift-master -- cgit v1.2.3 From 1b3be5f6c0d8b0c16dfb4c01744fe24ae830b3ce Mon Sep 17 00:00:00 2001 From: Thomas Wiest Date: Mon, 23 Feb 2015 15:48:15 -0500 Subject: removed kubernetes roles as they're just cruft at this point. --- roles/kubernetes_apiserver/README.md | 38 ------- roles/kubernetes_apiserver/defaults/main.yml | 2 - roles/kubernetes_apiserver/handlers/main.yml | 4 - roles/kubernetes_apiserver/meta/main.yml | 124 --------------------- roles/kubernetes_apiserver/tasks/main.yml | 25 ----- roles/kubernetes_apiserver/vars/main.yml | 2 - roles/kubernetes_controller_manager/README.md | 38 ------- .../defaults/main.yml | 2 - .../handlers/main.yml | 5 - roles/kubernetes_controller_manager/meta/main.yml | 124 --------------------- roles/kubernetes_controller_manager/tasks/main.yml | 7 -- roles/kubernetes_controller_manager/vars/main.yml | 2 - roles/kubernetes_kubelet/README.md | 38 ------- roles/kubernetes_kubelet/defaults/main.yml | 2 - roles/kubernetes_kubelet/files/kubelet.service | 10 -- roles/kubernetes_kubelet/handlers/main.yml | 4 - roles/kubernetes_kubelet/meta/main.yml | 124 --------------------- roles/kubernetes_kubelet/tasks/main.yml | 31 ------ .../kubernetes_kubelet/templates/cadvisor.manifest | 33 ------ roles/kubernetes_kubelet/templates/kubelet | 3 - roles/kubernetes_kubelet/vars/main.yml | 2 - roles/kubernetes_proxy/README.md | 38 ------- roles/kubernetes_proxy/defaults/main.yml | 2 - roles/kubernetes_proxy/handlers/main.yml | 4 - roles/kubernetes_proxy/meta/main.yml | 124 --------------------- roles/kubernetes_proxy/tasks/main.yml | 17 --- roles/kubernetes_proxy/vars/main.yml | 2 - roles/openshift_master/vars/main.yml | 2 +- 28 files changed, 1 insertion(+), 808 deletions(-) delete mode 100644 roles/kubernetes_apiserver/README.md delete mode 100644 roles/kubernetes_apiserver/defaults/main.yml delete mode 100644 roles/kubernetes_apiserver/handlers/main.yml delete mode 100644 roles/kubernetes_apiserver/meta/main.yml delete mode 100644 roles/kubernetes_apiserver/tasks/main.yml delete mode 100644 roles/kubernetes_apiserver/vars/main.yml delete mode 100644 roles/kubernetes_controller_manager/README.md delete mode 100644 roles/kubernetes_controller_manager/defaults/main.yml delete mode 100644 roles/kubernetes_controller_manager/handlers/main.yml delete mode 100644 roles/kubernetes_controller_manager/meta/main.yml delete mode 100644 roles/kubernetes_controller_manager/tasks/main.yml delete mode 100644 roles/kubernetes_controller_manager/vars/main.yml delete mode 100644 roles/kubernetes_kubelet/README.md delete mode 100644 roles/kubernetes_kubelet/defaults/main.yml delete mode 100644 roles/kubernetes_kubelet/files/kubelet.service delete mode 100644 roles/kubernetes_kubelet/handlers/main.yml delete mode 100644 roles/kubernetes_kubelet/meta/main.yml delete mode 100644 roles/kubernetes_kubelet/tasks/main.yml delete mode 100644 roles/kubernetes_kubelet/templates/cadvisor.manifest delete mode 100644 roles/kubernetes_kubelet/templates/kubelet delete mode 100644 roles/kubernetes_kubelet/vars/main.yml delete mode 100644 roles/kubernetes_proxy/README.md delete mode 100644 roles/kubernetes_proxy/defaults/main.yml delete mode 100644 roles/kubernetes_proxy/handlers/main.yml delete mode 100644 roles/kubernetes_proxy/meta/main.yml delete mode 100644 roles/kubernetes_proxy/tasks/main.yml delete mode 100644 roles/kubernetes_proxy/vars/main.yml diff --git a/roles/kubernetes_apiserver/README.md b/roles/kubernetes_apiserver/README.md deleted file mode 100644 index 225dd44b9..000000000 --- a/roles/kubernetes_apiserver/README.md +++ /dev/null @@ -1,38 +0,0 @@ -Role Name -========= - -A brief description of the role goes here. - -Requirements ------------- - -Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. - -Role Variables --------------- - -A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. - -Dependencies ------------- - -A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } - -License -------- - -BSD - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/kubernetes_apiserver/defaults/main.yml b/roles/kubernetes_apiserver/defaults/main.yml deleted file mode 100644 index ab2f8bd50..000000000 --- a/roles/kubernetes_apiserver/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for kubernetes_apiserver diff --git a/roles/kubernetes_apiserver/handlers/main.yml b/roles/kubernetes_apiserver/handlers/main.yml deleted file mode 100644 index 5ecb096f0..000000000 --- a/roles/kubernetes_apiserver/handlers/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# handlers file for kubernetes_apiserver -- name: restart kubernetes-apiserver - service: name=kubernetes-apiserver state=restarted diff --git a/roles/kubernetes_apiserver/meta/main.yml b/roles/kubernetes_apiserver/meta/main.yml deleted file mode 100644 index c5c362c60..000000000 --- a/roles/kubernetes_apiserver/meta/main.yml +++ /dev/null @@ -1,124 +0,0 @@ ---- -galaxy_info: - author: your name - description: - company: your company (optional) - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - min_ansible_version: 1.2 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - #platforms: - #- name: EL - # versions: - # - all - # - 5 - # - 6 - # - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Fedora - # versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - #- name: Ubuntu - # versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - # - trusty - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - #- name: Debian - # versions: - # - all - # - etch - # - lenny - # - squeeze - # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - #categories: - #- cloud - #- cloud:ec2 - #- cloud:gce - #- cloud:rax - #- clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - #- networking - #- packaging - #- system - #- web -dependencies: [] - # List your role dependencies here, one per line. Only - # dependencies available via galaxy should be listed here. - # Be sure to remove the '[]' above if you add dependencies - # to this list. - diff --git a/roles/kubernetes_apiserver/tasks/main.yml b/roles/kubernetes_apiserver/tasks/main.yml deleted file mode 100644 index 995c2702e..000000000 --- a/roles/kubernetes_apiserver/tasks/main.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -# tasks file for kubernetes_apiserver -- name: Install kubernetes - yum: pkg=kubernetes - -- name: Configure apiserver settings - lineinfile: - dest: /etc/sysconfig/kubernetes - regexp: "{{ item.regex }}" - line: "{{ item.line }}" - with_items: - - { regex: '^KUBE_API_MACHINES=', line: 'KUBE_API_MACHINES=\"{{ oo_node_ips | join(",") }}\"' } - - { regex: '^KUBE_API_ADDRESS=', line: 'KUBE_API_ADDRESS=\"0.0.0.0\"' } - notify: - - restart kubernetes-apiserver - -- name: Enable apiserver - service: name=kubernetes-apiserver enabled=yes state=started - -- name: Open firewalld port for apiserver - firewalld: port=8080/tcp permanent=false state=enabled - -- name: Save firewalld port for apiserver - firewalld: port=8080/tcp permanent=true state=enabled - diff --git a/roles/kubernetes_apiserver/vars/main.yml b/roles/kubernetes_apiserver/vars/main.yml deleted file mode 100644 index 1f5cb46d6..000000000 --- a/roles/kubernetes_apiserver/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for kubernetes_apiserver diff --git a/roles/kubernetes_controller_manager/README.md b/roles/kubernetes_controller_manager/README.md deleted file mode 100644 index 225dd44b9..000000000 --- a/roles/kubernetes_controller_manager/README.md +++ /dev/null @@ -1,38 +0,0 @@ -Role Name -========= - -A brief description of the role goes here. - -Requirements ------------- - -Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. - -Role Variables --------------- - -A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. - -Dependencies ------------- - -A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } - -License -------- - -BSD - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/kubernetes_controller_manager/defaults/main.yml b/roles/kubernetes_controller_manager/defaults/main.yml deleted file mode 100644 index 205f3e164..000000000 --- a/roles/kubernetes_controller_manager/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for kubernetes_controller_manager diff --git a/roles/kubernetes_controller_manager/handlers/main.yml b/roles/kubernetes_controller_manager/handlers/main.yml deleted file mode 100644 index a763ccd6c..000000000 --- a/roles/kubernetes_controller_manager/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# handlers file for kubernetes_controller_manager -- name: restart kubernetes-controller-manager - service: name=kubernetes-controller-manager state=restarted - diff --git a/roles/kubernetes_controller_manager/meta/main.yml b/roles/kubernetes_controller_manager/meta/main.yml deleted file mode 100644 index c5c362c60..000000000 --- a/roles/kubernetes_controller_manager/meta/main.yml +++ /dev/null @@ -1,124 +0,0 @@ ---- -galaxy_info: - author: your name - description: - company: your company (optional) - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - min_ansible_version: 1.2 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - #platforms: - #- name: EL - # versions: - # - all - # - 5 - # - 6 - # - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Fedora - # versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - #- name: Ubuntu - # versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - # - trusty - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - #- name: Debian - # versions: - # - all - # - etch - # - lenny - # - squeeze - # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - #categories: - #- cloud - #- cloud:ec2 - #- cloud:gce - #- cloud:rax - #- clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - #- networking - #- packaging - #- system - #- web -dependencies: [] - # List your role dependencies here, one per line. Only - # dependencies available via galaxy should be listed here. - # Be sure to remove the '[]' above if you add dependencies - # to this list. - diff --git a/roles/kubernetes_controller_manager/tasks/main.yml b/roles/kubernetes_controller_manager/tasks/main.yml deleted file mode 100644 index 68aee6f19..000000000 --- a/roles/kubernetes_controller_manager/tasks/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# tasks file for kubernetes_controller_manager -- name: Install kubernetes - yum: pkg=kubernetes - -- name: Enable controller-manager - service: name=kubernetes-controller-manager enabled=yes state=started diff --git a/roles/kubernetes_controller_manager/vars/main.yml b/roles/kubernetes_controller_manager/vars/main.yml deleted file mode 100644 index 4436c9358..000000000 --- a/roles/kubernetes_controller_manager/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for kubernetes_controller_manager diff --git a/roles/kubernetes_kubelet/README.md b/roles/kubernetes_kubelet/README.md deleted file mode 100644 index 225dd44b9..000000000 --- a/roles/kubernetes_kubelet/README.md +++ /dev/null @@ -1,38 +0,0 @@ -Role Name -========= - -A brief description of the role goes here. - -Requirements ------------- - -Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. - -Role Variables --------------- - -A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. - -Dependencies ------------- - -A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } - -License -------- - -BSD - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/kubernetes_kubelet/defaults/main.yml b/roles/kubernetes_kubelet/defaults/main.yml deleted file mode 100644 index 72daecfe7..000000000 --- a/roles/kubernetes_kubelet/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for kubernetes_kubelet diff --git a/roles/kubernetes_kubelet/files/kubelet.service b/roles/kubernetes_kubelet/files/kubelet.service deleted file mode 100644 index fef69a803..000000000 --- a/roles/kubernetes_kubelet/files/kubelet.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Kubernetes Kubelet Server -Documentation=https://github.com/GoogleCloudPlatform/kubernetes - -[Service] -EnvironmentFile=/etc/sysconfig/kubelet -ExecStart=/usr/local/bin/kubelet "$DAEMON_ARGS" - -[Install] -WantedBy=multi-user.target diff --git a/roles/kubernetes_kubelet/handlers/main.yml b/roles/kubernetes_kubelet/handlers/main.yml deleted file mode 100644 index 36b0c27b6..000000000 --- a/roles/kubernetes_kubelet/handlers/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# handlers file for kubernetes_kubelet -- name: restart kubelet - service: name=kubernetes-kubelet state=restarted diff --git a/roles/kubernetes_kubelet/meta/main.yml b/roles/kubernetes_kubelet/meta/main.yml deleted file mode 100644 index c5c362c60..000000000 --- a/roles/kubernetes_kubelet/meta/main.yml +++ /dev/null @@ -1,124 +0,0 @@ ---- -galaxy_info: - author: your name - description: - company: your company (optional) - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - min_ansible_version: 1.2 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - #platforms: - #- name: EL - # versions: - # - all - # - 5 - # - 6 - # - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Fedora - # versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - #- name: Ubuntu - # versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - # - trusty - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - #- name: Debian - # versions: - # - all - # - etch - # - lenny - # - squeeze - # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - #categories: - #- cloud - #- cloud:ec2 - #- cloud:gce - #- cloud:rax - #- clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - #- networking - #- packaging - #- system - #- web -dependencies: [] - # List your role dependencies here, one per line. Only - # dependencies available via galaxy should be listed here. - # Be sure to remove the '[]' above if you add dependencies - # to this list. - diff --git a/roles/kubernetes_kubelet/tasks/main.yml b/roles/kubernetes_kubelet/tasks/main.yml deleted file mode 100644 index b48c0039a..000000000 --- a/roles/kubernetes_kubelet/tasks/main.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -# tasks file for kubernetes_kubelet -- name: Install kubernetes - yum: pkg=kubernetes state=installed - -- name: Configure kubelet - lineinfile: - dest: /etc/sysconfig/kubernetes - regexp: "{{ item.regex }}" - line: "{{ item.line }}" - with_items: - - { regex: '^KUBE_ETCD_SERVERS=', line: 'KUBE_ETCD_SERVERS=\"http://{{ oo_master_ips[0] }}:4001\"' } - - { regex: '^KUBE_KUBELET_ADDRESS=', line: 'KUBE_KUBELET_ADDRESS=\"0.0.0.0\"' } - - { regex: '^KUBE_KUBELET_HOSTNAME_OVERRIDE=', line: 'KUBE_KUBELET_HOSTNAME_OVERRIDE=\"{{ hostvars[inventory_hostname].ansible_eth0.ipv4.address }}\"' } - notify: - - restart kubelet - - -#- name: write the cadvisor config -# template: src=cadvisor.manifest dest=/etc/kubernetes/manifests/cadvisor.manifest -# notify: -# - restart kubelet - -- name: Enable kubelet - service: name=kubernetes-kubelet enabled=yes state=started - -- name: Open firewalld port for the kubelet - firewalld: port=10250/tcp permanent=false state=enabled - -- name: Save firewalld port for the kubelet - firewalld: port=10250/tcp permanent=true state=enabled diff --git a/roles/kubernetes_kubelet/templates/cadvisor.manifest b/roles/kubernetes_kubelet/templates/cadvisor.manifest deleted file mode 100644 index 064803cbe..000000000 --- a/roles/kubernetes_kubelet/templates/cadvisor.manifest +++ /dev/null @@ -1,33 +0,0 @@ -version: v1beta2 -id: cadvisor-agent -containers: - - name: cadvisor - image: google/cadvisor:latest - ports: - - name: http - containerPort: 8080 - hostPort: 4194 - volumeMounts: - - name: varrun - mountPath: /var/run - readOnly: false - - name: varlibdocker - mountPath: /var/lib/docker - readOnly: true - - name: cgroups - mountPath: /sys/fs/cgroup - readOnly: true -volumes: - - name: varrun - source: - hostDir: - path: /var/run - - name: varlibdocker - source: - hostDir: - path: /var/lib/docker - - name: cgroups - source: - hostDir: - path: /sys/fs/cgroup - diff --git a/roles/kubernetes_kubelet/templates/kubelet b/roles/kubernetes_kubelet/templates/kubelet deleted file mode 100644 index fbf9321fe..000000000 --- a/roles/kubernetes_kubelet/templates/kubelet +++ /dev/null @@ -1,3 +0,0 @@ - -DAEMON_ARGS=" -etcd_servers=http://10.245.1.2:4001 -hostname_override=10.245.2.2 -address=0.0.0.0 -config=/etc/kubernetes/manifests" - diff --git a/roles/kubernetes_kubelet/vars/main.yml b/roles/kubernetes_kubelet/vars/main.yml deleted file mode 100644 index 000e642a2..000000000 --- a/roles/kubernetes_kubelet/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for kubernetes_kubelet diff --git a/roles/kubernetes_proxy/README.md b/roles/kubernetes_proxy/README.md deleted file mode 100644 index 225dd44b9..000000000 --- a/roles/kubernetes_proxy/README.md +++ /dev/null @@ -1,38 +0,0 @@ -Role Name -========= - -A brief description of the role goes here. - -Requirements ------------- - -Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. - -Role Variables --------------- - -A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. - -Dependencies ------------- - -A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } - -License -------- - -BSD - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/kubernetes_proxy/defaults/main.yml b/roles/kubernetes_proxy/defaults/main.yml deleted file mode 100644 index e0c322437..000000000 --- a/roles/kubernetes_proxy/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for kubernetes_proxy diff --git a/roles/kubernetes_proxy/handlers/main.yml b/roles/kubernetes_proxy/handlers/main.yml deleted file mode 100644 index 86ddde519..000000000 --- a/roles/kubernetes_proxy/handlers/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# handlers file for kubernetes_proxy -- name: restart kubernetes-proxy - service: name=kubernetes-proxy state=restarted diff --git a/roles/kubernetes_proxy/meta/main.yml b/roles/kubernetes_proxy/meta/main.yml deleted file mode 100644 index c5c362c60..000000000 --- a/roles/kubernetes_proxy/meta/main.yml +++ /dev/null @@ -1,124 +0,0 @@ ---- -galaxy_info: - author: your name - description: - company: your company (optional) - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) - min_ansible_version: 1.2 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - #platforms: - #- name: EL - # versions: - # - all - # - 5 - # - 6 - # - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Fedora - # versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - #- name: Ubuntu - # versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - # - trusty - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - #- name: Debian - # versions: - # - all - # - etch - # - lenny - # - squeeze - # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - #categories: - #- cloud - #- cloud:ec2 - #- cloud:gce - #- cloud:rax - #- clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - #- networking - #- packaging - #- system - #- web -dependencies: [] - # List your role dependencies here, one per line. Only - # dependencies available via galaxy should be listed here. - # Be sure to remove the '[]' above if you add dependencies - # to this list. - diff --git a/roles/kubernetes_proxy/tasks/main.yml b/roles/kubernetes_proxy/tasks/main.yml deleted file mode 100644 index 407c9ab46..000000000 --- a/roles/kubernetes_proxy/tasks/main.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -# tasks file for kubernetes_proxy -- name: Install kubernetes - yum: pkg=kubernetes state=installed - -- name: Configure kubernetes-proxy etcd servers - lineinfile: - dest: /etc/sysconfig/kubernetes - regexp: "{{ item.regex }}" - line: "{{ item.line }}" - with_items: - - { regex: '^KUBE_ETCD_SERVERS=', line: 'KUBE_ETCD_SERVERS=\"http://{{ oo_master_ips[0] }}:4001\"' } - notify: - - restart kubernetes-proxy - -- name: Enable proxy - service: name=kubernetes-proxy enabled=yes state=started diff --git a/roles/kubernetes_proxy/vars/main.yml b/roles/kubernetes_proxy/vars/main.yml deleted file mode 100644 index cbdcaa90d..000000000 --- a/roles/kubernetes_proxy/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for kubernetes_proxy diff --git a/roles/openshift_master/vars/main.yml b/roles/openshift_master/vars/main.yml index 1f5cb46d6..e5e5535e7 100644 --- a/roles/openshift_master/vars/main.yml +++ b/roles/openshift_master/vars/main.yml @@ -1,2 +1,2 @@ --- -# vars file for kubernetes_apiserver +# vars file for openshift_master -- cgit v1.2.3 From fa3122ce4edc48f1c4f4663257a5feaa69fc8c0b Mon Sep 17 00:00:00 2001 From: Thomas Wiest Date: Mon, 23 Feb 2015 15:55:58 -0500 Subject: changed tint to twiest and added gshipley env --- lib/aws_command.rb | 2 +- lib/gce_command.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/aws_command.rb b/lib/aws_command.rb index 1205fd5f7..0c714cdb4 100644 --- a/lib/aws_command.rb +++ b/lib/aws_command.rb @@ -7,7 +7,7 @@ module OpenShift module Ops class AwsCommand < Thor # WARNING: we do not currently support environments with hyphens in the name - SUPPORTED_ENVS = %w(prod stg int tint kint test jhonce amint tdint lint) + SUPPORTED_ENVS = %w(prod stg int twiest gshipley kint test jhonce amint tdint lint) option :type, :required => true, :enum => LaunchHelper.get_aws_host_types, :desc => 'The host type of the new instances.' diff --git a/lib/gce_command.rb b/lib/gce_command.rb index b23834af5..b7ebee18e 100644 --- a/lib/gce_command.rb +++ b/lib/gce_command.rb @@ -10,7 +10,7 @@ module OpenShift module Ops class GceCommand < Thor # WARNING: we do not currently support environments with hyphens in the name - SUPPORTED_ENVS = %w(prod stg int tint kint test jhonce amint tdint lint) + SUPPORTED_ENVS = %w(prod stg int twiest gshipley kint test jhonce amint tdint lint) option :type, :required => true, :enum => LaunchHelper.get_gce_host_types, :desc => 'The host type of the new instances.' -- cgit v1.2.3