-
Notifications
You must be signed in to change notification settings - Fork 2.3k
GCE-support #658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GCE-support #658
Changes from all commits
f0b52c7
6e80868
c22b5f2
071eee9
a3ba027
6b511f1
46f10c8
a8171a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| - set_fact: k8s_type=infra | ||
| - set_fact: sub_host_type="{{ type }}" | ||
| - set_fact: number_infra="{{ count }}" | ||
|
|
||
| - name: Generate infra instance names(s) | ||
| set_fact: | ||
| scratch_name: "{{ cluster_id }}-{{ k8s_type }}-{{ sub_host_type }}-{{ '%05x' | format(1048576 | random) }}" | ||
| register: infra_names_output | ||
| with_sequence: count={{ number_infra }} | ||
|
|
||
| - set_fact: | ||
| infra_names: "{{ infra_names_output.results | default([], true) | ||
| | oo_collect('ansible_facts') | ||
| | oo_collect('scratch_name') }}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| --- | ||
| - name: Populate oo_hosts_to_update group | ||
| hosts: localhost | ||
| gather_facts: no | ||
| vars_files: | ||
| - vars.yml | ||
| tasks: | ||
| - name: Evaluate oo_hosts_to_update | ||
| add_host: | ||
| name: "{{ node_ip }}" | ||
| groups: oo_hosts_to_update | ||
| ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}" | ||
| ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" | ||
|
|
||
| - include: ../../common/openshift-cluster/update_repos_and_packages.yml | ||
|
|
||
| - name: Populate oo_masters_to_config host group | ||
| hosts: localhost | ||
| gather_facts: no | ||
| vars_files: | ||
| - vars.yml | ||
| tasks: | ||
| - name: Evaluate oo_nodes_to_config | ||
| add_host: | ||
| name: "{{ node_ip }}" | ||
| ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}" | ||
| ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" | ||
| groups: oo_nodes_to_config | ||
|
|
||
| - name: Evaluate oo_first_master | ||
| add_host: | ||
| name: "{{ groups['tag_env-host-type-' ~ cluster_id ~ '-openshift-master'][0] }}" | ||
| ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}" | ||
| ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" | ||
| groups: oo_first_master | ||
| when: "'tag_env-host-type-{{ cluster_id }}-openshift-master' in groups" | ||
|
|
||
| #- include: config.yml | ||
| - include: ../../common/openshift-node/config.yml | ||
| vars: | ||
| openshift_cluster_id: "{{ cluster_id }}" | ||
| openshift_debug_level: 4 | ||
| openshift_deployment_type: "{{ deployment_type }}" | ||
| openshift_hostname: "{{ ansible_default_ipv4.address }}" | ||
| openshift_use_openshift_sdn: true | ||
| openshift_node_labels: "{{ lookup('oo_option', 'openshift_node_labels') }} " | ||
| os_sdn_network_plugin_name: "redhat/openshift-ovs-subnet" | ||
| osn_cluster_dns_domain: "{{ hostvars[groups.oo_first_master.0].openshift.dns.domain }}" | ||
| osn_cluster_dns_ip: "{{ hostvars[groups.oo_first_master.0].openshift.dns.ip }}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,33 +28,33 @@ | |
| type: "{{ k8s_type }}" | ||
| g_sub_host_type: "{{ sub_host_type }}" | ||
|
|
||
| - include: ../../common/openshift-cluster/set_node_launch_facts_tasks.yml | ||
| vars: | ||
| type: "infra" | ||
| count: "{{ num_infra }}" | ||
| - include: tasks/launch_instances.yml | ||
| vars: | ||
| instances: "{{ infra_names }}" | ||
| cluster: "{{ cluster_id }}" | ||
| type: "{{ k8s_type }}" | ||
| g_sub_host_type: "{{ sub_host_type }}" | ||
|
|
||
| - set_fact: | ||
| a_infra: "{{ infra_names[0] }}" | ||
| - add_host: name={{ a_infra }} groups=service_master | ||
|
|
||
| # - include: ../../common/openshift-cluster/set_infra_launch_facts_tasks.yml | ||
| # vars: | ||
| # type: "infra" | ||
| # count: "{{ num_infra }}" | ||
| # - include: tasks/launch_instances.yml | ||
| # vars: | ||
| # instances: "{{ infra_names }}" | ||
| # cluster: "{{ cluster_id }}" | ||
| # type: "{{ k8s_type }}" | ||
| # g_sub_host_type: "{{ sub_host_type }}" | ||
| # | ||
| # - set_fact: | ||
| # a_infra: "{{ infra_names[0] }}" | ||
| # - add_host: name={{ a_infra }} groups=service_master | ||
| # | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @menren hey, sorry for missing this earlier, but I just noticed this. So we use infra nodes, why is this commented out? We want it like the AWS playbook which has this section in.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use I tried to repair it with Currently the GCE deployment isn't working at all, with or without infra-node. I suppose nobody is working with it. If somebody is working with it, he/she has to tell me how it can work in the current state. By commenting this code, the rest is working. This PR fixes the standard deployment without infra and will allow people to work on GCE deployment and repair the infra-node
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see. I just tried and I was able to launch by making the infra section look the same on gce as it does in aws. So, it now looks like this in my branch: Locally, I also removed this file as it's no longer being used: I'm ok if we get this as a separate PR as I have some other things I had to patch to be able to launch a cluster in GCE. I'll @ mention you when I create my PR to make sure it works for you too.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @twiest good if you can repair the infra nodes for GCE because I work without it and don't know how it works exactly |
||
| - include: update.yml | ||
|
|
||
| - name: Deploy OpenShift Services | ||
| hosts: service_master | ||
| connection: ssh | ||
| gather_facts: yes | ||
| roles: | ||
| - openshift_registry | ||
| - openshift_router | ||
|
|
||
| - include: ../../common/openshift-cluster/create_services.yml | ||
| vars: | ||
| g_svc_master: "{{ service_master }}" | ||
| # | ||
| #- name: Deploy OpenShift Services | ||
| # hosts: service_master | ||
| # connection: ssh | ||
| # gather_facts: yes | ||
| # roles: | ||
| # - openshift_registry | ||
| # - openshift_router | ||
| # | ||
| #- include: ../../common/openshift-cluster/create_services.yml | ||
| # vars: | ||
| # g_svc_master: "{{ service_master }}" | ||
|
|
||
| - include: list.yml | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though this change makes sense, this seems unrelated to the purpose of this PR, why's this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this doesn't make sense to me. The way it's written it would use nova.ini in the same location as nova.py (ie in the git checkout) which I don't suspect anyone would modify in place. I think it'd be more likely that they'd expect it to look for it in cwd, do you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you that this change is not related at all to GCE ... however this change makes sense :
nova.ini is located in the same directory than nova.py
Getcwd will return the location from where we execute the script nova.py resulting in an error if the script is executed from directory different. So this is fixing that issue.
On AWS, GCE, LIBVIRT we take the .ini file in the same location as the .py
So I think it was just a mistake to use getcwd for Openstack
Anyways we can take this change off and make an other PR.
It's up to you to judge if it's worth for a minor change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with leaving it in.