Hide Forgot
Description of problem: In BYO playbook inventory I provide: > openshift_router_selector='region=infra,zone=router' Later in ansible log I see > "router_selector": "region=infra,zone=router" But at the end I see: > TASK: [openshift_hosted | Create OpenShift router] **************************** > changed: [ec2-52-90-203-180.compute-1.amazonaws.com] => {"changed": true, "cmd": ["/usr/local/bin/oadm", "router", "--create", "--replicas=4", "--namespace=default", "--service-account=router", "--selector=region=infra", "--credentials=/etc/origin/master/openshift-router.kubeconfig"], "delta": "0:00:04.623892", "end": "2016-04-18 12:44:12.223553", "rc": 0, "start": "2016-04-18 12:44:07.599661", "stderr": "\n================================================================================\nATTENTION: You are running oadm via a wrapper around 'docker run openshift3/ose:v3.2.0.15'.\nThis wrapper is intended only to be used to bootstrap an environment. Please\ninstall client tools on another host once you have granted cluster-admin\nprivileges to a user. \nSee https://docs.openshift.com/enterprise/latest/cli_reference/get_started_cli.html\n=================================================================================\n\nFlag --credentials has been deprecated, use --service-account to specify the service account the router will use to make API calls\ninfo: password for stats user admin has been set to 7su3ZkKZK4", "stdout": "deploymentconfig \"router\" created\nservice \"router\" created", "stdout_lines": ["deploymentconfig \"router\" created", "service \"router\" created"], "warnings": []} Basically selector is always `region=infra`. Version-Release number of selected component (if applicable): openshift-origin playbook git rev 2f4689814d openshift v3.2.0.15 installation on atomic-host How reproducible: always
Looks like openshift_master_facts and the provider playbooks reference openshift_router_selector and the byo documentation and openshift_hosted readme reference openshift_hosted_router_selector.
Also we need router replicas to be set based on number of nodes with the desired selector. I will test and report back tomorrow if this is already the case.
Unless replicas are specified (openshift_hosted_router_replicas=X), the replicas will be the number of nodes matching the selector provided. It looks like the filter that counts nodes isn't returning any matches so I'm going to run the logged json through the filters and see what isn't catching.
In fact - yes, seems like somebody installed the RPMs again or I removed from another machine. I'll test it tomorrow again. Thank you.
Proposed fix: https://github.com/openshift/openshift-ansible/pull/1766
*** Bug 1328902 has been marked as a duplicate of this bug. ***
Verified this bug with the latest PR, and PASS. Inventory file: openshift_hosted_router_selector="region=primary,zone=default" Ansible Output: TASK: [openshift_hosted | Collect nodes matching router selector] ************* ok: [x.x.x.x] => {"ansible_facts": {"openshift_hosted_router_nodes": ["qe-jialiu-node-registry-router-1"]}} TASK: [openshift_hosted | Create OpenShift router] **************************** changed: [x.x.x.x] => {"changed": true, "cmd": ["oadm", "router", "--create", "--replicas=1", "--namespace=default", "--service-account=router", "--selector=region=primary,zone=default", "--credentials=/etc/origin/master/openshift-router.kubeconfig", "--images=registry.qe.openshift.com/openshift3/ose-${component}:${version}"], "delta": "0:00:00.353303", "end": "2016-04-21 07:14:59.799366", "rc": 0, "start": "2016-04-21 07:14:59.446063", "stderr": "Flag --credentials has been deprecated, use --service-account to specify the service account the router will use to make API calls\ninfo: password for stats user admin has been set to CmVu23Oaj6", "stdout": "deploymentconfig \"router\" created\nservice \"router\" created", "stdout_lines": ["deploymentconfig \"router\" created", "service \"router\" created"], "warnings": []}
confirming the above with current master (006e52034)