foreman_ansible 14.2.1 → 14.2.3

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.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/foreman_ansible/locale/ca/foreman_ansible.js +359 -386
  3. data/app/assets/javascripts/foreman_ansible/locale/cs_CZ/foreman_ansible.js +443 -470
  4. data/app/assets/javascripts/foreman_ansible/locale/de/foreman_ansible.js +518 -545
  5. data/app/assets/javascripts/foreman_ansible/locale/en/foreman_ansible.js +291 -318
  6. data/app/assets/javascripts/foreman_ansible/locale/en_GB/foreman_ansible.js +317 -344
  7. data/app/assets/javascripts/foreman_ansible/locale/es/foreman_ansible.js +580 -607
  8. data/app/assets/javascripts/foreman_ansible/locale/fr/foreman_ansible.js +582 -609
  9. data/app/assets/javascripts/foreman_ansible/locale/gl/foreman_ansible.js +333 -360
  10. data/app/assets/javascripts/foreman_ansible/locale/it/foreman_ansible.js +395 -422
  11. data/app/assets/javascripts/foreman_ansible/locale/ja/foreman_ansible.js +582 -609
  12. data/app/assets/javascripts/foreman_ansible/locale/ka/foreman_ansible.js +575 -602
  13. data/app/assets/javascripts/foreman_ansible/locale/ko/foreman_ansible.js +402 -429
  14. data/app/assets/javascripts/foreman_ansible/locale/nl_NL/foreman_ansible.js +350 -377
  15. data/app/assets/javascripts/foreman_ansible/locale/pl/foreman_ansible.js +369 -396
  16. data/app/assets/javascripts/foreman_ansible/locale/pt_BR/foreman_ansible.js +580 -607
  17. data/app/assets/javascripts/foreman_ansible/locale/ru/foreman_ansible.js +391 -418
  18. data/app/assets/javascripts/foreman_ansible/locale/sv_SE/foreman_ansible.js +335 -362
  19. data/app/assets/javascripts/foreman_ansible/locale/zh_CN/foreman_ansible.js +584 -611
  20. data/app/assets/javascripts/foreman_ansible/locale/zh_TW/foreman_ansible.js +402 -429
  21. data/app/models/ansible_role.rb +3 -0
  22. data/app/models/ansible_variable.rb +4 -0
  23. data/app/models/host_ansible_role.rb +6 -0
  24. data/app/views/foreman_ansible/job_templates/capsule_update_-_ansible_default.erb +73 -0
  25. data/app/views/foreman_ansible/job_templates/capsule_upgrade_-_ansible_default.erb +1 -3
  26. data/app/views/foreman_ansible/job_templates/convert_to_rhel.erb +15 -1
  27. data/lib/foreman_ansible/remote_execution.rb +6 -0
  28. data/lib/foreman_ansible/version.rb +1 -1
  29. data/locale/ca/foreman_ansible.edit.po +1209 -0
  30. data/locale/ca/foreman_ansible.po +6 -33
  31. data/locale/ca/foreman_ansible.po.time_stamp +0 -0
  32. data/locale/cs_CZ/LC_MESSAGES/foreman_ansible.mo +0 -0
  33. data/locale/cs_CZ/foreman_ansible.edit.po +1225 -0
  34. data/locale/cs_CZ/foreman_ansible.po +6 -33
  35. data/locale/cs_CZ/foreman_ansible.po.time_stamp +0 -0
  36. data/locale/de/LC_MESSAGES/foreman_ansible.mo +0 -0
  37. data/locale/de/foreman_ansible.edit.po +1248 -0
  38. data/locale/de/foreman_ansible.po +6 -33
  39. data/locale/de/foreman_ansible.po.time_stamp +0 -0
  40. data/locale/en/foreman_ansible.edit.po +1202 -0
  41. data/locale/en/foreman_ansible.po +6 -33
  42. data/locale/en/foreman_ansible.po.time_stamp +0 -0
  43. data/locale/en_GB/LC_MESSAGES/foreman_ansible.mo +0 -0
  44. data/locale/en_GB/foreman_ansible.edit.po +1220 -0
  45. data/locale/en_GB/foreman_ansible.po +6 -33
  46. data/locale/en_GB/foreman_ansible.po.time_stamp +0 -0
  47. data/locale/es/LC_MESSAGES/foreman_ansible.mo +0 -0
  48. data/locale/es/foreman_ansible.edit.po +1247 -0
  49. data/locale/es/foreman_ansible.po +6 -33
  50. data/locale/es/foreman_ansible.po.time_stamp +0 -0
  51. data/locale/foreman_ansible.pot +47 -85
  52. data/locale/fr/LC_MESSAGES/foreman_ansible.mo +0 -0
  53. data/locale/fr/foreman_ansible.edit.po +1246 -0
  54. data/locale/fr/foreman_ansible.po +6 -33
  55. data/locale/fr/foreman_ansible.po.time_stamp +0 -0
  56. data/locale/gl/foreman_ansible.edit.po +1206 -0
  57. data/locale/gl/foreman_ansible.po +6 -33
  58. data/locale/gl/foreman_ansible.po.time_stamp +0 -0
  59. data/locale/it/LC_MESSAGES/foreman_ansible.mo +0 -0
  60. data/locale/it/foreman_ansible.edit.po +1224 -0
  61. data/locale/it/foreman_ansible.po +6 -33
  62. data/locale/it/foreman_ansible.po.time_stamp +0 -0
  63. data/locale/ja/LC_MESSAGES/foreman_ansible.mo +0 -0
  64. data/locale/ja/foreman_ansible.edit.po +1242 -0
  65. data/locale/ja/foreman_ansible.po +6 -33
  66. data/locale/ja/foreman_ansible.po.time_stamp +0 -0
  67. data/locale/ka/LC_MESSAGES/foreman_ansible.mo +0 -0
  68. data/locale/ka/foreman_ansible.edit.po +1227 -0
  69. data/locale/ka/foreman_ansible.po +6 -33
  70. data/locale/ka/foreman_ansible.po.time_stamp +0 -0
  71. data/locale/ko/LC_MESSAGES/foreman_ansible.mo +0 -0
  72. data/locale/ko/foreman_ansible.edit.po +1219 -0
  73. data/locale/ko/foreman_ansible.po +6 -33
  74. data/locale/ko/foreman_ansible.po.time_stamp +0 -0
  75. data/locale/nl_NL/foreman_ansible.edit.po +1214 -0
  76. data/locale/nl_NL/foreman_ansible.po +6 -33
  77. data/locale/nl_NL/foreman_ansible.po.time_stamp +0 -0
  78. data/locale/pl/foreman_ansible.edit.po +1209 -0
  79. data/locale/pl/foreman_ansible.po +6 -33
  80. data/locale/pl/foreman_ansible.po.time_stamp +0 -0
  81. data/locale/pt_BR/LC_MESSAGES/foreman_ansible.mo +0 -0
  82. data/locale/pt_BR/foreman_ansible.edit.po +1246 -0
  83. data/locale/pt_BR/foreman_ansible.po +6 -33
  84. data/locale/pt_BR/foreman_ansible.po.time_stamp +0 -0
  85. data/locale/ru/LC_MESSAGES/foreman_ansible.mo +0 -0
  86. data/locale/ru/foreman_ansible.edit.po +1227 -0
  87. data/locale/ru/foreman_ansible.po +6 -33
  88. data/locale/ru/foreman_ansible.po.time_stamp +0 -0
  89. data/locale/sv_SE/foreman_ansible.edit.po +1209 -0
  90. data/locale/sv_SE/foreman_ansible.po +6 -33
  91. data/locale/sv_SE/foreman_ansible.po.time_stamp +0 -0
  92. data/locale/zh_CN/LC_MESSAGES/foreman_ansible.mo +0 -0
  93. data/locale/zh_CN/foreman_ansible.edit.po +1241 -0
  94. data/locale/zh_CN/foreman_ansible.po +6 -33
  95. data/locale/zh_CN/foreman_ansible.po.time_stamp +0 -0
  96. data/locale/zh_TW/LC_MESSAGES/foreman_ansible.mo +0 -0
  97. data/locale/zh_TW/foreman_ansible.edit.po +1220 -0
  98. data/locale/zh_TW/foreman_ansible.po +6 -33
  99. data/locale/zh_TW/foreman_ansible.po.time_stamp +0 -0
  100. data/test/unit/host_ansible_role_test.rb +30 -0
  101. metadata +56 -4
  102. data/locale/action_names.rb +0 -7
@@ -4,6 +4,7 @@
4
4
  class AnsibleRole < ApplicationRecord
5
5
  audited
6
6
  include Authorizable
7
+ include Foreman::ObservableModel
7
8
 
8
9
  self.include_root_in_json = false
9
10
  validates :name, :presence => true, :uniqueness => true
@@ -28,6 +29,8 @@ class AnsibleRole < ApplicationRecord
28
29
  scoped_search :relation => :hostgroups,
29
30
  :on => :name, :rename => :hostgroup, :only_explicit => true
30
31
 
32
+ set_crud_hooks :ansible_role
33
+
31
34
  apipie :class, "A class representing #{model_name.human} object" do
32
35
  name 'Ansible role'
33
36
  refs 'AnsibleRole'
@@ -2,6 +2,8 @@
2
2
 
3
3
  # Represents the variables used in Ansible to parameterize playbooks
4
4
  class AnsibleVariable < LookupKey
5
+ include Foreman::ObservableModel
6
+
5
7
  belongs_to :ansible_role, :inverse_of => :ansible_variables
6
8
  validates :ansible_role_id, :presence => true
7
9
  before_validation :cast_default_value, :if => :override?
@@ -11,6 +13,8 @@ class AnsibleVariable < LookupKey
11
13
  scoped_search :relation => :ansible_role, :on => :name,
12
14
  :complete_value => true, :rename => :ansible_role
13
15
 
16
+ set_crud_hooks :ansible_variable
17
+
14
18
  def ansible?
15
19
  true
16
20
  end
@@ -2,10 +2,16 @@
2
2
 
3
3
  # Join model that hosts the connection between hosts and ansible_roles
4
4
  class HostAnsibleRole < ApplicationRecord
5
+ audited associated_with: :host
6
+
5
7
  belongs_to_host
6
8
  belongs_to :ansible_role
7
9
  acts_as_list scope: :host
8
10
 
9
11
  validates :ansible_role_id, :presence => true,
10
12
  :uniqueness => { :scope => :host_id }
13
+
14
+ def to_label
15
+ ansible_role.name
16
+ end
11
17
  end
@@ -0,0 +1,73 @@
1
+ <%#
2
+ name: Capsule Update Playbook
3
+ snippet: false
4
+ template_inputs:
5
+ - name: whitelist_options
6
+ required: false
7
+ input_type: user
8
+ advanced: false
9
+ value_type: plain
10
+ hidden_value: false
11
+ model: JobTemplate
12
+ job_category: Maintenance Operations
13
+ description_format: "%{template_name}"
14
+ provider_type: Ansible
15
+ kind: job_template
16
+ feature: ansible_run_capsule_update
17
+ %>
18
+
19
+ ---
20
+ - hosts: all
21
+ tasks:
22
+ <% if plugin_present?('foreman_theme_satellite') -%>
23
+ - name: Gather the rpm package facts
24
+ package_facts:
25
+ manager: auto
26
+
27
+ - name: Fail if the target server is a Satellite server
28
+ fail:
29
+ msg: "This playbook cannot be executed on a Satellite server. Use only on a Capsule server."
30
+ when: "'satellite' in ansible_facts.packages"
31
+
32
+ - name: Install|Update satellite-maintain if not present
33
+ package:
34
+ name: rubygem-foreman_maintain
35
+ state: latest
36
+
37
+ - block:
38
+ <%- whitelist_option = if input('whitelist_options').present?
39
+ "--whitelist=#{input('whitelist_options')}"
40
+ end -%>
41
+ - name: Update Capsule server using satellite-maintain
42
+ shell: satellite-maintain update run --assumeyes <%= whitelist_option %>
43
+ register: result
44
+
45
+ - name: Re-Gather the rpm package facts after the update
46
+ package_facts:
47
+ manager: auto
48
+
49
+ - name: satellite-maintain update return code is zero
50
+ debug:
51
+ msg: "Success! Capsule server update completed. Current version of Capsule server server is {{ ansible_facts.packages['satellite-capsule'][0]['version'] }}."
52
+
53
+ rescue:
54
+ - name: Print satellite-maintain output
55
+ debug:
56
+ var: result
57
+
58
+ - name: Grep top 10 Error messages from /var/log/foreman-installer/capsule.log
59
+ shell: grep '^\[ERROR' /var/log/foreman-installer/capsule.log | head -n10
60
+ register: output_grep
61
+
62
+ - name: Print grepped Error messages
63
+ debug:
64
+ var: output_grep.stdout_lines
65
+
66
+ - name: satellite-maintain update return code is non-zero
67
+ fail:
68
+ msg: "Failed! Capsule server update failed. See /var/log/foreman-installer/capsule.log in the Capsule server for more information"
69
+ <% else -%>
70
+ - name: Fail if foreman_theme_satellite is missing
71
+ fail:
72
+ msg: "Failed! The plugin foreman_theme_satellite is not present. This playbook is only for use with Satellite."
73
+ <% end -%>
@@ -24,8 +24,6 @@ feature: ansible_run_capsule_upgrade
24
24
 
25
25
  ---
26
26
  - hosts: all
27
- vars:
28
- target_version: "<%= input('target_version').present? ? input('target_version') : product_short_version %>"
29
27
  tasks:
30
28
  <% if plugin_present?('foreman_theme_satellite') -%>
31
29
  - name: Gather the rpm package facts
@@ -47,7 +45,7 @@ feature: ansible_run_capsule_upgrade
47
45
  "--whitelist=#{input('whitelist_options')}"
48
46
  end -%>
49
47
  - name: Upgrade Capsule server using satellite-maintain
50
- shell: satellite-maintain upgrade run --assumeyes --target-version={{ target_version }} <%= whitelist_option %>
48
+ shell: satellite-maintain upgrade run --assumeyes <%= whitelist_option %>
51
49
  register: result
52
50
 
53
51
  - name: Re-Gather the rpm package facts after the upgrade
@@ -20,11 +20,25 @@ template_inputs:
20
20
  advanced: false
21
21
  value_type: plain
22
22
  hidden_value: false
23
+ - name: ELS
24
+ required: false
25
+ input_type: user
26
+ description: Use an Extended Lifecycle Support (ELS) add-on subscription
27
+ advanced: false
28
+ value_type: plain
29
+ options: "yes\r\nno"
30
+ default: "no"
31
+ hidden_value: false
23
32
  model: JobTemplate
24
33
  job_category: Convert 2 RHEL
25
34
  provider_type: Ansible
26
35
  kind: job_template
27
36
  %>
37
+ <%-
38
+ ack = " --activationkey \"#{input_resource('Activation Key').name}\""
39
+ org = " --org \"#{@host.organization.label}\""
40
+ els = input('ELS') == "yes" ? " --els" : ""
41
+ -%>
28
42
  ---
29
43
  - hosts: all
30
44
  environment:
@@ -53,7 +67,7 @@ kind: job_template
53
67
  - "convert2rhel_version is version('2.0.0', '<')"
54
68
 
55
69
  - name: Start convert2rhel
56
- command: convert2rhel -y --activationkey "<%= input_resource('Activation Key').name %>" --org "<%= @host.organization.label %>"
70
+ command: convert2rhel -y <%= ack + org + els %>
57
71
 
58
72
  <%- if input('Restart') == "yes" -%>
59
73
  - name: Reboot the machine
@@ -40,6 +40,12 @@ module ForemanAnsible
40
40
  :description => N_('Upgrade Capsules on given Capsule server hosts'),
41
41
  :proxy_selector_override => ::RemoteExecutionProxySelector::INTERNAL_PROXY
42
42
  )
43
+ RemoteExecutionFeature.register(
44
+ :ansible_run_capsule_update,
45
+ N_('Update Capsules on given hosts'),
46
+ :description => N_('Update Capsules on given Capsule server hosts'),
47
+ :proxy_selector_override => ::RemoteExecutionProxySelector::INTERNAL_PROXY
48
+ )
43
49
  end
44
50
  end
45
51
  end
@@ -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 = '14.2.1'
7
+ VERSION = '14.2.3'
8
8
  end