SUSE-Cloud / automation

Automation scripts for development, testing, and CI
Apache License 2.0
69 stars 139 forks source link

Ensure extra_repos repo metadata updated (SOC-11390) #3925

Closed rtamalin closed 4 years ago

rtamalin commented 4 years ago

If the setup_zypper_repos role is included more than once, and the extra_repos value is different, we want to ensure that the metadata for the repo will be updated to include any additional RPMs added.

To ensure this happens we want the createrepo command to be run whenever the role is included to add/enable repos, rather than just the first time it is included, meaning that we don't want to guard the running of the command with an args: creates: repodata file.

Additionally to speed up subsequent runs of createrepo we can use the --update option, which re-uses existing repo metadata for files that previously existed.

rtamalin commented 4 years ago

I have kicked off https://ci.suse.de/blue/organizations/jenkins/openstack-ardana-fergal/detail/openstack-ardana-fergal/53/pipeline after rebasing my test branch on top of this PR, and will verify that, once the setup_zypper_repos has been included during the update phase, both expected versions of the ardana-ansible package that are present in the extra_repos repo on the deployer are visible when I run zypper se -v ardana-ansible.

rtamalin commented 4 years ago
Loading repository data...
Reading installed packages...

S | Name           | Type       | Version                          | Arch   | Repository                    
--+----------------+------------+----------------------------------+--------+-------------------------------
v | ardana-ansible | package    | 8.0+git.1596735237.54109b1-1.1   | noarch | SUSE-OpenStack-Cloud-8-Pool   
    name: ardana-ansible
  | ardana-ansible | srcpackage | 8.0+git.1596735237.54109b1-1.1   | noarch | SUSE-OpenStack-Cloud-8-Pool   
    name: ardana-ansible
v | ardana-ansible | package    | 8.0+git.1596735237.54109b1-266.1 | noarch | SUSE-OpenStack-Cloud-8-Updates
    name: ardana-ansible
  | ardana-ansible | srcpackage | 8.0+git.1596735237.54109b1-266.1 | noarch | SUSE-OpenStack-Cloud-8-Updates
    name: ardana-ansible
v | ardana-ansible | package    | 8.0+git.1599579598.4c16942-1.1   | noarch | extra-repos                   
    name: ardana-ansible
i | ardana-ansible | package    | 8.0+git.1599579702.5b45e55-1.1   | noarch | extra-repos                   
    name: ardana-ansible
i | ardana-ansible | package    | 8.0+git.1599579702.5b45e55-1.1   | noarch | (System Packages)             
    name: ardana-ansible

I can see both copies of ardana-ansible in extra repos, so this is definitely working now.