Wolfgang Kulhanek
2018-12-04 af831991c7c752a1215cfc4cff6a028e31f410d7
Updated for use with Satellite
1 files deleted
3 files modified
99 ■■■■ changed files
ansible/configs/rhte-oc-cluster-vms/files/oc-cluster.service.j2 4 ●●●● patch | view | raw | blame | history
ansible/configs/rhte-oc-cluster-vms/files/registries.conf 24 ●●●●● patch | view | raw | blame | history
ansible/configs/rhte-oc-cluster-vms/post_software.yml 18 ●●●● patch | view | raw | blame | history
ansible/roles/set-repositories/tasks/satellite-repos.yml 53 ●●●●● patch | view | raw | blame | history
ansible/configs/rhte-oc-cluster-vms/files/oc-cluster.service.j2
@@ -5,7 +5,11 @@
[Service]
{% if osrelease is version_compare("3.10", ">=") %}
{% if repo_method == "satellite" %}
ExecStart=/bin/oc cluster up --base-dir={{ ocp_root }} --public-hostname={{ hostname }} --routing-suffix=apps.{{ hostname }} --loglevel=1 --image='{{ satellite_url }}:5000/red_hat_gpte-ocp_3_11-openshift3_ose-${component}:${version}'
{% else %}
ExecStart=/bin/oc cluster up --base-dir={{ ocp_root }} --public-hostname={{ hostname }} --routing-suffix=apps.{{ hostname }} --loglevel=1
{% endif %}
{% else %}
ExecStart=/bin/oc cluster up --host-config-dir={{ ocp_root }}/config --host-data-dir={{ ocp_root }}/data --host-pv-dir={{ ocp_root }}/pv --host-volumes-dir={{ ocp_root }}/volumes --use-existing-config=true --public-hostname={{ hostname }} --routing-suffix=apps.{{ hostname }} --loglevel=1
{% endif %}
ansible/configs/rhte-oc-cluster-vms/files/registries.conf
File was deleted
ansible/configs/rhte-oc-cluster-vms/post_software.yml
@@ -20,17 +20,24 @@
  - name: Ensure software is installed
    yum:
      name: "{{ item }}"
      state: latest
<<<<<<< Updated upstream
    with_items:
    - git
    - vim
    - ansible
    - docker
=======
      name:
      - git
      - vim
      - ansible
      - docker
>>>>>>> Stashed changes
  - name: Copy docker registries.conf file
    copy:
      src: ./files/registries.conf
    template:
      src: ./files/registries.j2
      dest: /etc/containers/registries.conf
      mode: 0644
      owner: root
@@ -45,7 +52,9 @@
      group: root
  - name: Copy docker config.conf file
    when: osrelease is version_compare('3.11', '>=')
    when:
    - osrelease is version_compare('3.11', '>=')
    - repo_method != "satellite"
    template:
      src: ./files/config.j2
      dest: /root/.docker/config.json
@@ -54,6 +63,7 @@
      group: root
  - name: Restart docker
    when: repo_method != "satellite"
    systemd:
      name: docker
      state: restarted
ansible/roles/set-repositories/tasks/satellite-repos.yml
@@ -18,31 +18,48 @@
    name: katello-ca-consumer-*.noarch
    state: absent
- name: Download Cert from Satellite
  get_url:
    url: "https://{{satellite_url}}/pub/katello-ca-consumer-latest.noarch.rpm"
    dest: /root/katello-ca-consumer-latest.noarch.rpm
    mode: 0664
    validate_certs: no
- name: Install Cert
  # use rpm here to avoid issue when yum is broken (chicken&egg)
  command: "rpm -Uvh {{satellite_url}}/pub/katello-ca-consumer-latest.noarch.rpm"
  command: "rpm -Uvh /root/katello-ca-consumer-latest.noarch.rpm"
  args:
    warn: no
- name: Delete Cert Package
  file:
    name: /root/katello-ca-consumer-latest.noarch.rpm
    state: absent
- name: Register with activation-key
  command: >
    subscription-manager register
    --org="{{satellite_org}}"
    --activationkey="{{ satellite_activationkey }}" --force
  redhat_subscription:
    state: present
    server_hostname: "{{satellite_url}}"
    activationkey: "{{satellite_activationkey}}"
    org_id: "{{satellite_org}}"
- name: Enable Repositories
  command: subscription-manager repos --enable=rhel-7-server-satellite-tools-6.3-rpms
# - name: Enable Repositories
#   command: subscription-manager repos --enable=rhel-7-server-satellite-tools-6.3-rpms
- name: Install Katello Agent
  yum:
    name: katello-agent
    state: latest
# - name: Install Katello Agent
#   yum:
#     name: katello-agent
#     state: latest
- name: Start Katello Agent
  service:
    name: goferd
    state: started
    enabled: yes
# - name: Start Katello Agent
#   service:
#     name: goferd
#     state: started
#     enabled: yes
- name: Enable repos for rhel
  command: subscription-manager repos --enable "{{ item }}"
- name: Enable repos for RHEL
  rhsm_repository:
    name: "{{ item }}"
    state: enabled
  with_items:
    - '{{ rhel_repos }}'