Skip to content
This repository was archived by the owner on Dec 9, 2020. It is now read-only.

Making providers common#126

Merged
cooktheryan merged 14 commits intoopenshift:masterfrom
cooktheryan:common-providers
Jan 13, 2017
Merged

Making providers common#126
cooktheryan merged 14 commits intoopenshift:masterfrom
cooktheryan:common-providers

Conversation

@cooktheryan
Copy link
Contributor

I will need testing done from @dav1x @themurph and/or @pschiffe

This is the first big chunk of work to make the providers common this should benefit OSP and Azure in the future and ensure that a change made on one common role is applied to all groups.

@@ -0,0 +1,2 @@
# The Reference Architecture Common Playbooks and Roles
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not move these to the root of the repo?

playbooks/
roles/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ahhh interesting. I had not thought about that. Let me move some pieces around

@cooktheryan
Copy link
Contributor Author

vars_files:
- vars/main.yaml
roles:
- ../roles/openshift-emptydir-quota
Copy link
Contributor

Choose a reason for hiding this comment

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

will probably be better to add a symlink to ../roles in the playbooks directory rather than reference the role this way.

Copy link
Contributor Author

@cooktheryan cooktheryan Nov 22, 2016

Choose a reason for hiding this comment

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

Will do

gather_facts: yes
become: yes
vars_files:
- vars/main.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

vars_files may be problematic, I would suggest that required settings be passed in for generic playbooks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be able to just remove them as it doesn't appear that the vars matter in regards to the play

@cooktheryan
Copy link
Contributor Author

Both atomic containerized and RHEL install are good on AWS

@scollier
Copy link
Contributor

scollier commented Dec 8, 2016

aos-ci-test

@openshift-bot
Copy link

@@ -15,7 +15,7 @@
- validate-etcd
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this playbook should be called post-validation and not validation.

@@ -0,0 +1,38 @@
---
- name: disable unneeded repos
command: subscription-manager repos --disable='*'
Copy link
Contributor

Choose a reason for hiding this comment

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

There should probably be a prior step to determine what repos are currently enabled and only disable/enable when needed. Examples below shows what I mean as well as moving the conditional around:

- name: Example playbooks
  hosts: example_hosts
  roles:
  - role: rhsm-repos
    when: "{{ ansible_distribution == 'RedHat' and openshift_manage_repos is true }}"
# a bit handwavy, since this output needs to be filtered, or a diff command used, but this example assumes that the output here is just a bare list of repos enabled
- command: subscription-manager repos --list-enabled
  register: subscription_manager_repos
  changed_when: false

- block:
    - name: disable repos
      command: "subscription-manager{{ ' --disable='.join(repos_to_remove) + ' --enable'.join(repos_to_add)}}"
  when: "{{ repos_to_remove | length > 0 or repos_to_add | length > 0 }}"
  vars:
    repo_list:
    - rhel-7-server-rpms
    - rhel-7-server-extras-rpms
    - rhel-7-server-ose-3.3-rpms
    repos_to_remove: "{{ subscription_manager_repos | difference(repo_list) }}"
    repos_to_add: "{{ repo_list | difference(subscription_manager_repos) }}"

....

pool: "{{ rhsm_pool }}"
when: "'Subscribed' not in subscribed.stdout and rhsm_activation_key is defined and rhsm_activation_key != 'None'"
register: register_key_result
register: register_key_result and ansible_distribution == "RedHat"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd move the ansible_distribution == "RedHat" either to a conditional on a block that contains all the tasks, or move it into a conditional on the role in the playbook.

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'm really digging this whole bock idea

Copy link
Contributor

Choose a reason for hiding this comment

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

Blocks are awesome. Allowing for the conditionals to be applied in one place is nice, but setting vars at the block-scope is even better :)

@cooktheryan
Copy link
Contributor Author

@detiber went block crazy and verified with both centos/origin and rhel/ocp. Will look into the repos enable/disable next week

@cooktheryan
Copy link
Contributor Author

@detiber I can't get manage to create a sane output from the disable/enable play. Using the above prints everything but the stdout_lines when trying to parse the var down to use stdout_lines there are still too many extra items. Below is the output of stdout_lines

    "subscription_manager_repos.stdout_lines": [
        "+----------------------------------------------------------+", 
        "    Available Repositories in /etc/yum.repos.d/redhat.repo", 
        "+----------------------------------------------------------+", 
        "Repo ID:   rhel-7-fast-datapath-htb-rpms", 
        "Repo Name: Red Hat Enterprise Linux Fast Datapath Beta (RHEL 7 Server) (RPMs)", 
        "Repo URL:  https://cdn.redhat.com/content/htb/rhel/server/7/$basearch/fast-datapath/os", 
        "Enabled:   1", 
        "", 
        "Repo ID:   rhel-7-server-rpms", 
        "Repo Name: Red Hat Enterprise Linux 7 Server (RPMs)", 
        "Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/os", 
        "Enabled:   1", 
        "", 
        "Repo ID:   rhel-7-fast-datapath-rpms", 
        "Repo Name: Red Hat Enterprise Linux Fast Datapath (RHEL 7 Server) (RPMs)", 
        "Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/fast-datapath/os", 
        "Enabled:   1"
    ]

Any input appreciated just not sure how to parse or what to parse.

@cooktheryan
Copy link
Contributor Author

@dav1x @themurph @pschiffe can I get you guys to test this now that the code blocks are in place?

@dav1x
Copy link
Contributor

dav1x commented Dec 14, 2016

@cooktheryan ill try and pull down tomorrow and test a deploy on my environment

@dav1x
Copy link
Contributor

dav1x commented Jan 9, 2017

@cooktheryan tested and works great. excited to get it going after the INI changes.

@cooktheryan
Copy link
Contributor Author

GCE Validation

PLAY RECAP *********************************************************************
localhost : ok=23 changed=16 unreachable=0 failed=0
ocp-infra-dskl : ok=173 changed=53 unreachable=0 failed=0
ocp-infra-pn6h : ok=173 changed=53 unreachable=0 failed=0
ocp-master-nwjn : ok=542 changed=180 unreachable=0 failed=0
ocp-master-r97j : ok=351 changed=122 unreachable=0 failed=0
ocp-master-s14k : ok=351 changed=122 unreachable=0 failed=0
ocp-node-2z9x : ok=166 changed=56 unreachable=0 failed=0
ocp-node-p6cl : ok=166 changed=56 unreachable=0 failed=0

Connection to 35.185.27.235 closed.

Deployment is complete. OpenShift Console can be found at https://master.gce-validate.sysdeseng.com

@DanyC97
Copy link

DanyC97 commented Jan 12, 2017

hi all, over last week i've been working on getting OS Origin on CentOS running on VMware. Through that process i found few issues....

Looking at this chunk it sounds i should better hold pushing any PRs, how far you guys think this PR is from being merged?

@cooktheryan
Copy link
Contributor Author

cooktheryan commented Jan 12, 2017 via email

@DanyC97
Copy link

DanyC97 commented Jan 12, 2017

@cooktheryan perfect, thanks for quick response 👍

@dav1x
Copy link
Contributor

dav1x commented Jan 13, 2017

@DanyC97 hey man. I did a lot of work on VMware as a provider ping me if I can help with your CentOS deploy

@cooktheryan cooktheryan merged commit a30e0f4 into openshift:master Jan 13, 2017
@DanyC97
Copy link

DanyC97 commented Jan 15, 2017

@dav1x thanks you for the offer, definitely i'll need your help 👍

so my confusion comes from few things:

  • the req for atomic-openshift-utils rpm is not found on CentOS repo hence the playbook fails

I'll go tomorrow to try and redeploy from scratch using CentOS on VMware and latest changes you guys done so i can validate it.

jaywryan pushed a commit to jaywryan/openshift-ansible-contrib that referenced this pull request Jul 3, 2018
* Making providers common

* moving directory locations

* using links and removal of vars file callout

* rename of file

* went block crazy

* cleanup

* add to remove

* missing Pyyaml package in README

* let docker actually setup docker storage and start the service

* name change

* Fix for vmware. Will variablize in the future

* catchup to test common providers against master

* should only be schedulable nodes
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants