diff --git a/roles/rpm_ostree_install/meta/main.yml b/roles/rpm_ostree_install/meta/main.yml new file mode 100644 index 0000000..61d3ffe --- /dev/null +++ b/roles/rpm_ostree_install/meta/main.yml @@ -0,0 +1,2 @@ +--- +allow_duplicates: true diff --git a/roles/rpm_ostree_install_verify/meta/main.yml b/roles/rpm_ostree_install_verify/meta/main.yml new file mode 100644 index 0000000..61d3ffe --- /dev/null +++ b/roles/rpm_ostree_install_verify/meta/main.yml @@ -0,0 +1,2 @@ +--- +allow_duplicates: true diff --git a/roles/rpm_ostree_install_verify/tasks/main.yml b/roles/rpm_ostree_install_verify/tasks/main.yml index 9e879a9..86884f0 100644 --- a/roles/rpm_ostree_install_verify/tasks/main.yml +++ b/roles/rpm_ostree_install_verify/tasks/main.yml @@ -8,10 +8,9 @@ # # Parameter: # package - name of a single package +# binary - name of binary to check for (optional) # # Requirements: -# Package must install a binary that is the same as the package name -# i.e. rpm-ostree install wget installs a binary named wget # This role must be run after the reboot following rpm-ostree install of a package # @@ -20,6 +19,12 @@ msg: "No packages specified" when: package is undefined +# The 'binary' fact can be set to something other than the package name +# if needed +- name: Setup binary fact + set_fact: + bin: "{{ binary if binary is defined else package }}" + - name: Get rpm-ostree status --json output command: rpm-ostree status --json register: installed @@ -43,8 +48,8 @@ msg: "{{ package }} not in rpm-ostree status output" when: "'{{ package }}' not in installed_pkgs" -- name: Check for {{ package }} binary - command: command -v {{ package }} +- name: Check for {{ bin }} binary + command: command -v {{ bin }} - name: Check {{ package }} in rpmdb command: rpm -q {{ package }} diff --git a/roles/rpm_ostree_uninstall/meta/main.yml b/roles/rpm_ostree_uninstall/meta/main.yml new file mode 100644 index 0000000..61d3ffe --- /dev/null +++ b/roles/rpm_ostree_uninstall/meta/main.yml @@ -0,0 +1,2 @@ +--- +allow_duplicates: true diff --git a/roles/rpm_ostree_uninstall_verify/meta/main.yml b/roles/rpm_ostree_uninstall_verify/meta/main.yml new file mode 100644 index 0000000..61d3ffe --- /dev/null +++ b/roles/rpm_ostree_uninstall_verify/meta/main.yml @@ -0,0 +1,2 @@ +--- +allow_duplicates: true diff --git a/roles/rpm_ostree_uninstall_verify/tasks/main.yml b/roles/rpm_ostree_uninstall_verify/tasks/main.yml index 6a7f511..d1b7e59 100644 --- a/roles/rpm_ostree_uninstall_verify/tasks/main.yml +++ b/roles/rpm_ostree_uninstall_verify/tasks/main.yml @@ -8,10 +8,9 @@ # # Parameter: # package - the name of a single package +# binary - the name of a binary (optional) # # Requirements: -# Package must install a binary that is the same as the package name -# i.e. rpm-ostree uninstall wget installs a binary named wget # This role must be run after the reboot following rpm-ostree install of a package # @@ -20,6 +19,12 @@ msg: "No packages specified" when: package is undefined +# The 'binary' fact can be set to something other than the package name +# if needed +- name: Setup binary fact + set_fact: + bin: "{{ binary if binary is defined else package }}" + - name: Get rpm-ostree status --json output command: rpm-ostree status --json register: installed @@ -51,8 +56,8 @@ msg: "{{ package }} in rpm-ostree status output" when: "'{{ package }}' in installed_pkgs" -- name: Fail if binary for {{ package }} is installed - command: command -v {{ package }} +- name: Fail if binary for {{ bin }} is installed + command: command -v {{ bin }} register: binary failed_when: binary.rc != 1