Skip to content
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

Added a BYO playbook for configuring NetworkManager on nodes #2771

Merged
merged 1 commit into from
Nov 22, 2016

Conversation

stevekuznetsov
Copy link
Contributor

In order to do a full install of OpenShfit using the byo/config.yml
playbook, it is currently required that NetworkManager be installed
and configured on the nodes prior to the installation. This playbook
introduces a very simple default configuration that can be used to
install, configure and enable NetworkManager on their nodes.

Signed-off-by: Steve Kuznetsov [email protected]

@sdodson PTAL

@stevekuznetsov stevekuznetsov force-pushed the skuznets/network-manager branch from 2af4188 to ef0d5af Compare November 9, 2016 19:08

- name: determine the default interface
shell: "/sbin/ip route get to {{ default_route.stdout }} | awk '{print $3}'"
register: default_interface
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it simpler to use ansible_default_ipv4['interface'] ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I copied this step from where-ever else this project was looking up the default interface. If that variable is what we want (why not IPv6?) then I will switch it over, sure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could get ipv6 as well, but as "/sbin/ip route list match 0.0.0.0/0" will return ip v4, I assumed that's what was required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, understood. @sdodson does using the ansible_default_ipv4['interface'] fact seem reasonable here for you as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevekuznetsov it does.

state: present
create: yes
with_items:
- regexp: '^USE_PEERDNS='
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about:

     lineinfile:
        dest: '/etc/sysconfig/network-scripts/ifcfg-{{ default_interface.stdout }}'
        regexp: '^{{ item }}='
        line: '^{{ item }}=yes'
        state: present
        create: yes
      with_items:
      - 'USE_PEERDNS'
      - 'NM_CONTROLLED'

So one can avoid repetition, and directly abstract the configuration we want to be at 'yes' ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that collapses nicely

In order to do a full install of OpenShfit using the byo/config.yml
playbook, it is currently required that NetworkManager be installed
and configured on the nodes prior to the installation. This playbook
introduces a very simple default configuration that can be used to
install, configure and enable NetworkManager on their nodes.

Signed-off-by: Steve Kuznetsov <[email protected]>
@stevekuznetsov stevekuznetsov force-pushed the skuznets/network-manager branch from ef0d5af to 9af7aa9 Compare November 22, 2016 15:23
@stevekuznetsov
Copy link
Contributor Author

@mscherer addressed your comments

@sdodson sdodson merged commit bfc9239 into openshift:master Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants