foreman_ansible 17.0.0 → 17.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23d1f9629ff2caacd1322856bf376bd84148aef120a412dee5db12a529b5dff8
4
- data.tar.gz: 396385b5da1a3ee2bd3f553e5d6ce7e292462d8bfec93d0391383c60e8bf0088
3
+ metadata.gz: 5e243de04365a1e12fc7c0915b3e146938b93976f06aff3398c4b7274b8dda84
4
+ data.tar.gz: ac2fff50c3ef20f2b1e2b73076211f8e63d7e711c9e8b343c5dab9a02705308d
5
5
  SHA512:
6
- metadata.gz: 8c72ed55cb353947241f7d1abc539dd7feb080241769c8380756fce4d3d7d3d0127c8e94a7fd889d1c940a280eee91113cd1589bf4119dee7d5ca8fe884fefce
7
- data.tar.gz: effbadb40abecc14215f1acae2f93f6d8a07b9b975cfca745c4331902051ddaeff42dc5d4018e60464480b03514a02a55e48e7e8d64c7fdf0ac0af5a399027a5
6
+ metadata.gz: 30efb4b03cb9e14792f0921064edfe1feebb71b551b70bf3c5e6f193a7efe971bb3ea5e655490d4a19104b8eab7e71f4f033f60a60c8e8b429973cb4aee1f63b
7
+ data.tar.gz: d3920b1eec66b5138b78eff5c86854866605e16300a9f44dc6f1794fb943b6f7b24f97728fc0978612aea35a8a58d5ae9b1bb5763dd707d9abef375e15d41d94
@@ -34,26 +34,40 @@ model: JobTemplate
34
34
  # For Windows targets use the win_package module instead.
35
35
  ---
36
36
  - hosts: all
37
+ vars:
38
+ pkg_name: "<%= input('name') %>"
39
+ pkg_names_for_dnf: "<%= input('name').respond_to?(:join) ? input('name').join(' ') : input('name') %>"
37
40
  <%- if input('pre_script').present? -%>
38
41
  pre_tasks:
39
42
  - shell: "<%= input('pre_script') %>"
40
43
  <%- end -%>
41
44
  tasks:
45
+ - name: Validate input
46
+ ansible.builtin.assert:
47
+ that:
48
+ - pkg_name is defined
49
+ - pkg_name | length > 0
50
+ fail_msg: "The 'name' input cannot be empty. A package name must be provided."
51
+ success_msg: "Valid 'name' input: '{{ pkg_name }}'"
42
52
  <%= indent(4) { snippet('check_bootc_status') } %>
43
- - name: Enable bootc overlay
44
- shell:
45
- cmd: 'bootc usr-overlay'
46
- register: out
47
- ignore_errors: true
53
+ <%- if input('state') == 'present' -%>
54
+ - name: Ensure package is present transiently for image mode machines
55
+ shell: "dnf --transient install -y {{ pkg_names_for_dnf }}"
48
56
  when: is_bootc_host
49
- - debug: var=out
50
- - name: Install packages via dnf for image mode machines
51
- package:
52
- use: 'dnf'
53
- <%= indent(8) { to_yaml({"name" => input('name')}).gsub(/---\n/, '') } -%>
54
- state: <%= input('state') %>
57
+ <%- end -%>
58
+ <%- if input('state') == 'latest' -%>
59
+ - name: Ensure package is at the latest version transiently for image mode machines
60
+ shell: |
61
+ dnf --transient install -y {{ pkg_names_for_dnf }}
62
+ dnf --transient update -y {{ pkg_names_for_dnf }}
55
63
  when: is_bootc_host
56
- - name: Install packages normally
64
+ <%- end -%>
65
+ <%- if input('state') == 'absent' -%>
66
+ - name: Remove packages transiently for image mode machines
67
+ shell: "dnf --transient remove -y {{ pkg_names_for_dnf }}"
68
+ when: is_bootc_host
69
+ <%- end -%>
70
+ - name: Install or remove packages normally
57
71
  package:
58
72
  <%= indent(8) { to_yaml({"name" => input('name')}).gsub(/---\n/, '') } -%>
59
73
  state: <%= input('state') %>
@@ -4,5 +4,5 @@
4
4
  # This way other parts of Foreman can just call ForemanAnsible::VERSION
5
5
  # and detect what version the plugin is running.
6
6
  module ForemanAnsible
7
- VERSION = '17.0.0'
7
+ VERSION = '17.0.1'
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_ansible
3
3
  version: !ruby/object:Gem::Version
4
- version: 17.0.0
4
+ version: 17.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Lobato Garcia