#771 Deploy mirrors-countme (only) as RPM package
Merged 3 years ago by nphilipp. Opened 3 years ago by nphilipp.
fedora-infra/ nphilipp/ansible main--there-can-only-be-one-mirrors-countme  into  main

@@ -110,23 +110,32 @@ 

    tags:

      - web-data

  

- - name: install countme user gitconfig

-   copy: src=countme.gitconfig dest=/srv/countme/.gitconfig mode=0664 owner=countme group=countme

+ - name: install the python3-mirrors-countme RPM package

+   package:

+     name: python3-mirrors-countme

+     state: present

    tags:

      - web-data

+     - packages

  

- - name: checkout mirrors-countme from git

-   git:

-     repo: https://pagure.io/mirrors-countme

-     dest: /srv/countme/mirrors-countme

-     version: prod

-   register: gitcountme

-   tags:

-     - web-data

  

- - name: install mirrors-countme from git checkout

-   command: "pip3 install --no-index --no-deps /srv/countme/mirrors-countme"

-   when: "gitcountme is changed"

+ - name: remove local mirrors-countme git repo, scripts and Python package

+   # Using `shell` here because `file` doesn't know wild cards

+   shell: >-

+     shopt -s nullglob;

+     rm -rfv \

+         /srv/countme/mirrors-countme \

+         /usr/local/bin/countme-csv2sqlite.sh \

+         /usr/local/bin/countme-sqlite2csv.sh \

+         /usr/local/bin/countme-totals.py \

+         /usr/local/bin/countme-update-rawdb.sh \

+         /usr/local/bin/countme-update-totals.sh \

+         /usr/local/bin/parse-access-log.py \

+         /usr/local/lib/python3.*/site-packages/countme \

+         /usr/local/lib/python3.*/site-packages/mirrors_countme-*-py3.*.egg*

+   register: wda_rm_local_pypkg

+   changed_when: wda_rm_local_pypkg.stdout != ""

+   failed_when: wda_rm_local_pypkg.rc != 0

    tags:

      - web-data

  

This also ensures that the previously cloned git repository and local
installation of the Python package and associated scripts are removed.

Signed-off-by: Nils Philippsen nils@redhat.com

Metadata Update from @nphilipp:
- Pull-request tagged with: post-freeze

3 years ago

Metadata Update from @nphilipp:
- Pull-request untagged with: post-freeze
- Pull-request tagged with: freeze-break-request

3 years ago

Same as with #766, didn't fully consider the schedule when tagging with post-freeze.

rebased onto 4c65750e468c570fc493c5685887c178aea53685

3 years ago

rebased onto c0a653f24f6f55197e8bafb6db93c2b1f2a6f899

3 years ago

Looks good to me. Ideally after running this playbook we should remove the 'remove these things' section... +1 anyhow.

@kevin We could also remove these things manually, but I have this idea that if something was added using Ansible, it should be removed by it as well, for trackability. What do you say?

Yes, I am 100% good with removing them via ansible, but once they are removed the removal is a noop and can itself be cleaned up, no?

rebased onto 16d3e948adf621ac251ee451c907fa6c81ed1847

3 years ago

rebased onto 16d3e948adf621ac251ee451c907fa6c81ed1847

3 years ago

Yes, I am 100% good with removing them via ansible, but once they are removed the removal is a noop and can itself be cleaned up, no?

Sure! I just wanted to leave some trace of it somewhere other than the system itself.

rebased onto 27b41a4

3 years ago

rebased onto 27b41a4

3 years ago

Pull-Request has been merged by nphilipp

3 years ago