I need you to add a task to manage repos into the base role. The task 
should perform actions to create the necessary repository entries in the 
host, then trigger an “update packages” type call to verify the host is 
running the latest packages. Repo files are currently located under 
library/repos/*

Care should be taken with the RHEL systems since they have a rolling-update 
model. Performing an update against the LinuxCOE content on a RHEL6 host 
will update everything and in turn, make a RHEL6.2 host into a RHEL6e host. 
I would leave RHEL alone until the end.

For the SLES hosts, the service pack level should normally be maintained. 
SP2 should receive the SP2 repo definition. The errata hosts should receive 
the errata repo. Errata servers should have a marker file located at 
/etc/buildadmin with content errata

This is what I have so far:

---
- hosts: buildservers
  remote_user: root


  tasks:
  - name: add epel repo
    yum_repository:
      name: epel_repo
      description: EPEL YUM repo
      baseurl: file:///srv/repos/local
      baseurl: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/RHEL-6.6Server-x86_64/RPMS.os
      baseurl: http:
//linuxcoe9.houston.hpecorp.net/linuxcoe/Fedora-EPEL/6Server/x86_64
      baseurl: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/RHEL-6.2Server-x86_64/RPMS.os
      baseurl: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/RedHat-yum/6.2Server/en/os/x86_64
      baseurl: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/RHEL-6.4Server-x86_64/RPMS.os
      baseurl: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/Fedora-EPEL/6/x86_64
      baseurl: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/Fedora-EPEL/6/x86_64
      baseurl: file:///srv/repos/local
      baseurl: https://rpm.nodesource.com/pub_6.x/el/7/$basearch
      baseurl: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/RHEL-ALT-7.4Server-aarch64/RPMS.os/
      baseurl: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/RHEL-7.4Server-x86_64/RPMS.os
      baseurl: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/RedHat-updates-yum/7.4Server/en/os/x86_64
      baseurl: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/RHEL-7.0Server-x86_64/RPMS.os
      baseurl: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/RedHat-updates-yum/7.0Server/en/os/x86_64
      baseurl: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/RHEL-8.0-BaseOS_Snapshot-4Server-x86_64/RPMS.os/
    when:
      - (ansible_distribution|lower == "rhel" and 
ansible_distribution_major_version|int >= 6)
  - name: add apt repo
    apt_repository:
      repo: deb 
http://sdgxfs.sde.rdlabs.hpecorp.net/snapshots/ftp.debian.org/2011.11.26 
squeeze main contrib
      repo: deb http://archive.debian.org/debian wheezy main contrib
      repo: deb http://deb.debian.org/debian/ jessie main contrib non-free
      state: present
    when:
      - (ansible_distribution|lower == "debian" and 
ansible_distribution_major_version|int >= 6)
  - name: add zypper repo
    zypper_repository:
      name: zypper_repository
      repo: file:/srv/repos/plaindir
      repo: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/SLE-11-SP4-SDK-x86_64/disc1/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE-updates/SLES11-SP4-Updates/sle-11-x86_64/
      repo: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/SLE-11-SDK-x86_64/disc1/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE/x86_64/SLE-11-SDK/CD1/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE/x86_64/SLE-11-SDK/CD2/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE/x86_64/SLES11/CD1/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE/x86_64/SLES11/CD2/
      repo: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/SLE-11-SP1-SDK-x86_64/disc1/
      repo: baseurl=http:
//blofly.us.rdlabs.hpecorp.net/mrepo/SLES-11-SP1-x86_64/disc1/
      repo: baseurl=http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE-updates/SLES11-SP1-Updates/sle-11-x86_64/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE-yum/x86_64/SLES11-SP1/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE/i386/SLES11-SP1/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE/i386/SLE11-SDK-SP1/
      repo: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/SLE-11-SP2-SDK-x86_64/disc1/
      repo: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/SLES-11-SP2-x86_64/disc1/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE-updates/SLES11-SP2-Updates/sle-11-x86_64/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE-yum/x86_64/SLES11-SP2/
      repo: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/SLE-11-SP3-SDK-x86_64/disc1/
      repo: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/SLES-11-SP3-x86_64/disc1/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE-updates/SLES11-SP3-Updates/sle-11-x86_64/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE-yum/x86_64/SLES11-SP3/
      repo: file:/srv/repos/plaindir
      repo: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/SLE-12-SP3-SDK-x86_64/disc1/
      repo: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/SLE-12-SP3-Server-x86_64/disc1/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE-updates/SLE12-SDK-Updates/Updates/SLE-SDK/12-SP3/x86_64/update/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE-updates/SLES12-Updates/Updates/SLE-SERVER/12-SP3/x86_64/update/
      repo: http:
//linuxcoe4.houston.hpecorp.net/LinuxCOE/SuSE/x86_64/SLE-12-SDK/CD1/
      repo: http:
//linuxcoe4.houston.hpecorp.net/LinuxCOE/SuSE/x86_64/SLES12/CD1/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE-updates/SLE12-SDK-Updates/Updates/SLE-SDK/12/x86_64/update/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE-updates/SLES12-Updates/Updates/SLE-SERVER/12/x86_64/update/
      repo: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/SLE-12-SP1-SDK-x86_64/disc1/
      repo: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/SLE-12-SP1-Server-x86_64/disc1/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE-updates/SLE12-SDK-Updates/Updates/SLE-SDK/12-SP1/12-SP1/x86_64/update/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE-updates/SLES12-Updates/Updates/SLE-SERVER/12-SP1/12-SP1/x86_64/update/
      repo: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/SLE-12-SP2-SDK-x86_64/disc1/
      repo: http:
//blofly.us.rdlabs.hpecorp.net/mrepo/SLE-12-SP2-Server-x86_64/disc1/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE-updates/SLE12-SDK-Updates/Updates/SLE-SDK/12-SP2/x86_64/update/
      repo: http:
//linuxcoe9.houston.hpecorp.net/LinuxCOE/SuSE-updates/SLES12-Updates/Updates/SLE-SERVER/12-SP2/x86_64/update/
      state: present
    when:
      - (ansible_distribution|lower == "sles" and 
ansible_distribution_major_version|int >= 11)


I really don't know if I'm on the right track here! Can anyone help with 
this please?!

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/678bac9f-f850-44a5-b9c0-d34d66e3ef60%40googlegroups.com.

Reply via email to