Skip to content

Commit

Permalink
lint fixes for fake_installer_rpm role
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Sep 1, 2023
1 parent 9306732 commit 8acfcd5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion roles/fake_installer_rpm/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
fake_installer_rpm_repo: "/tmp/fake-installer-repo"
satellite_fake_installer_rpm_repo: "/tmp/fake-installer-repo"
8 changes: 4 additions & 4 deletions roles/fake_installer_rpm/molecule/satellite/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
hosts: all
gather_facts: true
become: true
vars:
foreman_repositories_version: "2.4"
foreman_repositories_katello_version: "4.0"
roles:
- theforeman.operations.puppet_repositories
- role: theforeman.operations.puppet_repositories
vars:
foreman_repositories_version: "2.4"
foreman_repositories_katello_version: "4.0"
- theforeman.operations.foreman_repositories
12 changes: 6 additions & 6 deletions roles/fake_installer_rpm/molecule/satellite/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
hosts: all
gather_facts: false
tasks:
- name: satellite-installer RPM can be installed
package:
- name: Install satellite-installer RPM
ansible.builtin.package:
name: satellite-installer
state: present

- name: find satellite-installer symlink
stat:
- name: Find satellite-installer symlink
ansible.builtin.stat:
path: /usr/sbin/satellite-installer
register: satellite_installer

- name: check satellite-installer symlink exists
assert:
- name: Check satellite-installer symlink exists
ansible.builtin.assert:
that:
- satellite_installer.stat.exists
- satellite_installer.stat.islnk
11 changes: 5 additions & 6 deletions roles/fake_installer_rpm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,27 @@
ansible.builtin.template:
src: satellite-installer.spec.j2
dest: "{{ ansible_env.HOME }}/rpmbuild/SPECS/satellite-installer.spec"
mode: 0644
mode: '0644'

- name: Build satellite-installer RPM
ansible.builtin.shell: "rpmbuild -ba SPECS/satellite-installer.spec" # noqa command-instead-of-shell
args:
chdir: "{{ ansible_env.HOME }}/rpmbuild"
register: build_result
changed_when: true
tags:
- molecule-idempotence-notest

- name: Copy satellite-installer RPM to local repo
ansible.builtin.copy:
src: "{{ ansible_env.HOME }}/rpmbuild/RPMS/x86_64/"
dest: "{{ fake_installer_rpm_repo }}"
dest: "{{ satellite_fake_installer_rpm_repo }}"
remote_src: true
mode: 0644
mode: '0644'
tags:
- molecule-idempotence-notest

- name: Create a local repository
ansible.builtin.command: "createrepo --update {{ fake_installer_rpm_repo }}"
ansible.builtin.command: "createrepo --update {{ satellite_fake_installer_rpm_repo }}"
changed_when: true
tags:
- molecule-idempotence-notest
Expand All @@ -45,6 +44,6 @@
ansible.builtin.yum_repository:
name: fake-installer-rpm
description: Local repository for satellite-installer fake RPM
baseurl: "file://{{ fake_installer_rpm_repo }}"
baseurl: "file://{{ satellite_fake_installer_rpm_repo }}"
enabled: true
gpgcheck: false

0 comments on commit 8acfcd5

Please sign in to comment.