Skip to content

Commit

Permalink
Merge pull request #44 from antonym/switch_rhel_registration
Browse files Browse the repository at this point in the history
Switch to using Ansible for node registration
  • Loading branch information
antonym authored Nov 29, 2018
2 parents e02f6b5 + e7099c7 commit a47e598
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 40 deletions.
11 changes: 2 additions & 9 deletions playbooks/deploy-osp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,6 @@
become: true
become_user: stack

- name: Copy rhel-registration scripts to templates directory
synchronize:
src: /usr/share/openstack-tripleo-heat-templates/extraconfig/pre_deploy/rhel-registration
dest: /home/stack/templates/
delegate_to: "{{ inventory_hostname }}"
become_user: stack

- name: Setting up overcloud configuations
template:
src: "{{ item.src }}"
Expand All @@ -185,8 +178,8 @@
- src: "osp/{{ redhat_osp_version }}/overcloud/node-info.yaml.j2"
dest: "/home/stack/templates/node-info.yaml"
mode: "0644"
- src: "osp/{{ redhat_osp_version }}/overcloud/environment-rhel-registration.yaml.j2"
dest: "/home/stack/templates/rhel-registration/environment-rhel-registration.yaml"
- src: "osp/{{ redhat_osp_version }}/overcloud/ansible-osp-registration.yml.j2"
dest: "/home/stack/ansible-osp-registration.yml"
mode: "0644"
- src: "osp/{{ redhat_osp_version }}/overcloud/overcloud-deploy.sh.j2"
dest: "/home/stack/scripts/overcloud-deploy.sh"
Expand Down
33 changes: 33 additions & 0 deletions playbooks/osp/13/overcloud/ansible-osp-registration.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
- name: Register OSP 13 repos on Nodes
hosts: Controller:Compute:CephStorage:SwiftStorage
become: yes
vars:
repos:
- rhel-7-server-rpms
- rhel-7-server-extras-rpms
- rhel-7-server-rh-common-rpms
- rhel-ha-for-rhel-7-server-rpms
- rhel-7-server-openstack-13-rpms
tasks:
- name: Register system
redhat_subscription:
username: "{{ redhat_username }}"
password: "{{ redhat_password }}"
pool_ids: "{{ redhat_pool_id }}"
- name: Disable all repos
command: "subscription-manager repos --disable *"
- name: Enable Controller node repos
command: "subscription-manager repos --enable {{ '{{' }} item {{ '}}' }}"
with_items: "{{ '{{' }} repos {{ '}}' }}"

- name: Register Ceph Repos
hosts: Controller:CephStorage
become: yes
vars:
repos:
- rhel-7-server-rhceph-3-mon-rpms
tasks:
- name: Enable Ceph Repos on Controller and Ceph nodes
command: "subscription-manager repos --enable {{ '{{' }} item {{ '}}' }}"
with_items: "{{ '{{' }} repos {{ '}}' }}"
27 changes: 0 additions & 27 deletions playbooks/osp/13/overcloud/environment-rhel-registration.yaml.j2

This file was deleted.

8 changes: 4 additions & 4 deletions playbooks/osp/13/overcloud/overcloud-deploy.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ source /home/stack/stackrc
openstack overcloud deploy --templates \
-e /home/stack/templates/node-info.yaml \
-e /home/stack/templates/undercloud_ssl_camap.yaml \
{% if redhat_overcloud_register | bool %}
-e /home/stack/templates/rhel-registration/environment-rhel-registration.yaml \
-e /home/stack/templates/rhel-registration/rhel-registration-resource-registry.yaml \
{% endif %}
{% if enable_ceph_storage | bool %}
-e /usr/share/openstack-tripleo-heat-templates/environments/ceph-ansible/ceph-ansible.yaml \
-e /home/stack/templates/ceph-custom-config.yaml \
Expand Down Expand Up @@ -42,3 +38,7 @@ openstack overcloud deploy --templates \
-e /usr/share/openstack-tripleo-heat-templates/environments/services-docker/neutron-ovn-ha.yaml \
--ntp-server pool.ntp.org \
2>&1 | tee /home/stack/logs/overcloud_install.log

{% if redhat_overcloud_register | bool %}
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i /usr/bin/tripleo-ansible-inventory /home/stack/ansible-osp-registration.yml
{% endif %}

0 comments on commit a47e598

Please sign in to comment.