foreman_puppet 5.0.0 → 5.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -7
  3. data/Rakefile +0 -5
  4. data/app/graphgl/foreman_puppet/types/environment.rb +1 -4
  5. data/app/graphgl/foreman_puppet/types/puppetclass.rb +1 -4
  6. data/app/models/concerns/foreman_puppet/extensions/host.rb +1 -1
  7. data/app/models/foreman_puppet/puppetclass.rb +2 -2
  8. data/app/views/foreman_puppet/environments/welcome.html.erb +5 -0
  9. data/app/views/foreman_puppet/puppetclass_lookup_keys/welcome.html.erb +1 -1
  10. data/app/views/foreman_puppet/puppetclasses/_selected_classes.html.erb +1 -1
  11. data/app/views/hosts/select_multiple_puppet_proxy.html.erb +5 -0
  12. data/app/views/provisioning_templates/temp/autoyast_orcharhino_finish.erb +31 -0
  13. data/app/views/provisioning_templates/temp/preseed_orcharhino_finish.erb +90 -0
  14. data/app/views/provisioning_templates/temp/provision/autoyast_orcharhino_default.erb +336 -0
  15. data/app/views/provisioning_templates/temp/snippet/_or_al_client.erb +32 -0
  16. data/app/views/provisioning_templates/temp/snippet/_or_deb_client.erb +175 -0
  17. data/app/views/provisioning_templates/temp/snippet/_or_ol_client.erb +37 -0
  18. data/app/views/provisioning_templates/temp/snippet/_or_sles_client.erb +85 -0
  19. data/lib/foreman_puppet/register.rb +1 -1
  20. data/lib/foreman_puppet/version.rb +1 -1
  21. data/lib/tasks/foreman_puppet_tasks.rake +0 -10
  22. data/locale/ca/LC_MESSAGES/foreman_puppet.mo +0 -0
  23. data/locale/ca/foreman_puppet.edit.po +1221 -0
  24. data/locale/ca/foreman_puppet.po +44 -8
  25. data/locale/ca/foreman_puppet.po.time_stamp +0 -0
  26. data/locale/cs_CZ/LC_MESSAGES/foreman_puppet.mo +0 -0
  27. data/locale/cs_CZ/foreman_puppet.edit.po +1208 -0
  28. data/locale/cs_CZ/foreman_puppet.po +45 -9
  29. data/locale/cs_CZ/foreman_puppet.po.time_stamp +0 -0
  30. data/locale/de/LC_MESSAGES/foreman_puppet.mo +0 -0
  31. data/locale/de/foreman_puppet.edit.po +1300 -0
  32. data/locale/de/foreman_puppet.po +49 -13
  33. data/locale/de/foreman_puppet.po.time_stamp +0 -0
  34. data/locale/en/LC_MESSAGES/foreman_puppet.mo +0 -0
  35. data/locale/en/foreman_puppet.edit.po +998 -0
  36. data/locale/en/foreman_puppet.po +42 -6
  37. data/locale/en/foreman_puppet.po.time_stamp +0 -0
  38. data/locale/en/foreman_puppet.pox +0 -0
  39. data/locale/en_GB/LC_MESSAGES/foreman_puppet.mo +0 -0
  40. data/locale/en_GB/foreman_puppet.edit.po +1197 -0
  41. data/locale/en_GB/foreman_puppet.po +44 -8
  42. data/locale/en_GB/foreman_puppet.po.time_stamp +0 -0
  43. data/locale/es/LC_MESSAGES/foreman_puppet.mo +0 -0
  44. data/locale/es/foreman_puppet.edit.po +1275 -0
  45. data/locale/es/foreman_puppet.po +77 -39
  46. data/locale/es/foreman_puppet.po.time_stamp +0 -0
  47. data/locale/foreman_puppet.pot +81 -25
  48. data/locale/fr/LC_MESSAGES/foreman_puppet.mo +0 -0
  49. data/locale/fr/foreman_puppet.edit.po +1290 -0
  50. data/locale/fr/foreman_puppet.po +67 -28
  51. data/locale/fr/foreman_puppet.po.time_stamp +0 -0
  52. data/locale/gl/LC_MESSAGES/foreman_puppet.mo +0 -0
  53. data/locale/gl/foreman_puppet.edit.po +1203 -0
  54. data/locale/gl/foreman_puppet.po +44 -8
  55. data/locale/gl/foreman_puppet.po.time_stamp +0 -0
  56. data/locale/it/LC_MESSAGES/foreman_puppet.mo +0 -0
  57. data/locale/it/foreman_puppet.edit.po +1233 -0
  58. data/locale/it/foreman_puppet.po +47 -10
  59. data/locale/it/foreman_puppet.po.time_stamp +0 -0
  60. data/locale/ja/LC_MESSAGES/foreman_puppet.mo +0 -0
  61. data/locale/ja/foreman_puppet.edit.po +1223 -0
  62. data/locale/ja/foreman_puppet.po +60 -24
  63. data/locale/ja/foreman_puppet.po.time_stamp +0 -0
  64. data/locale/ka/LC_MESSAGES/foreman_puppet.mo +0 -0
  65. data/locale/ka/foreman_puppet.po +875 -0
  66. data/locale/ko/LC_MESSAGES/foreman_puppet.mo +0 -0
  67. data/locale/ko/foreman_puppet.edit.po +1197 -0
  68. data/locale/ko/foreman_puppet.po +45 -9
  69. data/locale/ko/foreman_puppet.po.time_stamp +0 -0
  70. data/locale/messages.mo +0 -0
  71. data/locale/nl_NL/LC_MESSAGES/foreman_puppet.mo +0 -0
  72. data/locale/nl_NL/foreman_puppet.edit.po +1228 -0
  73. data/locale/nl_NL/foreman_puppet.po +44 -8
  74. data/locale/nl_NL/foreman_puppet.po.time_stamp +0 -0
  75. data/locale/pl/LC_MESSAGES/foreman_puppet.mo +0 -0
  76. data/locale/pl/foreman_puppet.edit.po +1238 -0
  77. data/locale/pl/foreman_puppet.po +45 -9
  78. data/locale/pl/foreman_puppet.po.time_stamp +0 -0
  79. data/locale/pt_BR/LC_MESSAGES/foreman_puppet.mo +0 -0
  80. data/locale/pt_BR/foreman_puppet.edit.po +1281 -0
  81. data/locale/pt_BR/foreman_puppet.po +78 -41
  82. data/locale/pt_BR/foreman_puppet.po.time_stamp +0 -0
  83. data/locale/ru/LC_MESSAGES/foreman_puppet.mo +0 -0
  84. data/locale/ru/foreman_puppet.edit.po +1240 -0
  85. data/locale/ru/foreman_puppet.po +45 -9
  86. data/locale/ru/foreman_puppet.po.time_stamp +0 -0
  87. data/locale/sv_SE/LC_MESSAGES/foreman_puppet.mo +0 -0
  88. data/locale/sv_SE/foreman_puppet.edit.po +1205 -0
  89. data/locale/sv_SE/foreman_puppet.po +44 -8
  90. data/locale/sv_SE/foreman_puppet.po.time_stamp +0 -0
  91. data/locale/zh_CN/LC_MESSAGES/foreman_puppet.mo +0 -0
  92. data/locale/zh_CN/foreman_puppet.edit.po +1212 -0
  93. data/locale/zh_CN/foreman_puppet.po +65 -29
  94. data/locale/zh_CN/foreman_puppet.po.time_stamp +0 -0
  95. data/locale/zh_TW/LC_MESSAGES/foreman_puppet.mo +0 -0
  96. data/locale/zh_TW/foreman_puppet.edit.po +1197 -0
  97. data/locale/zh_TW/foreman_puppet.po +45 -9
  98. data/locale/zh_TW/foreman_puppet.po.time_stamp +0 -0
  99. data/package.json +7 -7
  100. data/test/graphql/mutations/hosts/create_mutation_test.rb +1 -2
  101. data/test/unit/foreman_puppet/global_id_test.rb +13 -0
  102. data/webpack/src/Components/Environments/Welcome.js +25 -6
  103. data/webpack/src/Extends/Host/PuppetTab/index.js +2 -0
  104. metadata +108 -58
@@ -0,0 +1,175 @@
1
+ <%#
2
+ kind: snippet
3
+ name: or_deb_client
4
+ model: ProvisioningTemplate
5
+ snippet: true
6
+ description: template for debian provisioning
7
+ %>
8
+ <%
9
+ content_facet = host_content_facet(@host)
10
+ apt_run = 'apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"'
11
+ apt_install = apt_run + ' -y install'
12
+ apt_upgrade = apt_run + ' -o APT::Get::Upgrade-Allow-New="true" -y upgrade'
13
+ apt_update = 'apt-get -y update'
14
+
15
+ if !host_param("or_client_repo_url").nil?
16
+ or_client_repo_url = host_param("or_client_repo_url")
17
+ elsif !host_param("or_#{@host.operatingsystem.name.downcase}_client_repo_prefix").nil?
18
+ or_client_repo_url = host_param("or_#{@host.operatingsystem.name.downcase}_client_repo_prefix") + @host.operatingsystem.major.gsub('.', '_')
19
+ else
20
+ or_client_repo_url = nil
21
+ end
22
+ if content_facet && content_facet.content_source_name
23
+ host_content_fqdn = content_facet.content_source_name
24
+ host_content_url = "https://"+content_facet.content_source_name
25
+ else
26
+ host_content_fqdn = foreman_server_fqdn
27
+ host_content_url = foreman_server_url
28
+ end
29
+ if !host_param('http-proxy').nil?
30
+ http_proxy = host_param('http-proxy')
31
+ if !host_param('http-proxy-port').nil?
32
+ http_proxy_port = host_param('http-proxy-port')
33
+ else
34
+ http_proxy_port = "3129"
35
+ end
36
+ end
37
+ if !host_param('http-proxy-user').nil? && !host_param('http-proxy-password').nil?
38
+ http_proxy_user = host_param('http-proxy-user')
39
+ http_proxy_password = host_param('http-proxy-password')
40
+ proxy_uri = http_proxy ? "http://#{http_proxy_user}:#{http_proxy_password}@#{http_proxy}:#{http_proxy_port}" : nil
41
+ else
42
+ proxy_uri = http_proxy ? "http://#{http_proxy}:#{http_proxy_port}" : nil
43
+ end
44
+
45
+ use_trusted_gpg_d =
46
+ if @host.operatingsystem.name == 'Debian' && @host.operatingsystem.major.to_i >= 11
47
+ true
48
+ elsif @host.operatingsystem.name == 'Ubuntu' && @host.operatingsystem.major.split('.')[0].to_i >= 22
49
+ true
50
+ else
51
+ false
52
+ end
53
+ %>
54
+
55
+ <%- if @host.operatingsystem.family == 'Debian' -%>
56
+ echo "Installing or_deb_client repository"
57
+
58
+ <%- if or_client_repo_url.nil? -%>
59
+ echo "================================= Warning ============================================="
60
+ echo "Warning: To provision Debian clients, you need to prepare an 'or_deb_client'-repository"
61
+ echo " and write it's location in the global parameter 'or_<%= @host.operatingsystem.name.downcase %>_client_repo_prefix'."
62
+ echo "================================= Warning ============================================="
63
+ <%- end -%>
64
+
65
+ <%- if !content_facet || !content_facet.content_source_name -%>
66
+ echo "================================= Warning ============================================="
67
+ echo " No content source found. Setting default to <%= foreman_server_fqdn %>"
68
+ echo "================================= Warning ============================================="
69
+ <%- end -%>
70
+
71
+
72
+ <% if proxy_uri -%>
73
+ # Add http proxy to apt
74
+ echo 'Acquire::http::Proxy "<%= proxy_uri %>";' >> /etc/apt/apt.conf.d/proxy.conf
75
+ echo 'Acquire::http::Proxy::<%= @preseed_server.split(":")[0] %> "DIRECT";' >> /etc/apt/apt.conf.d/proxy.conf
76
+
77
+ # Add http proxy to wget
78
+ echo 'use_proxy=yes' >> /etc/wgetrc
79
+ echo 'http_proxy=<%= proxy_uri %>' >> /etc/wgetrc
80
+ echo 'https_proxy=<%= proxy_uri %>' >> /etc/wgetrc
81
+ <% end -%>
82
+
83
+ <% if @host.operatingsystem.name == 'Ubuntu' -%>
84
+ # Disable Phased-Updates for Ubuntu
85
+ cat << EOF >/etc/apt/apt.conf.d/98phased-updates
86
+ APT::Get::Always-Include-Phased-Updates "true";
87
+ EOF
88
+ <% end -%>
89
+
90
+ echo "Ensure gnupg is installed, which is needed for interacting with 'apt-key'"
91
+ <%= apt_update %>
92
+ <%= apt_install %> gnupg
93
+
94
+ echo "Install orcharhino repositories"
95
+ mkdir -p /etc/apt/sources.list.d
96
+
97
+ <% if use_trusted_gpg_d %>
98
+ mkdir -p /etc/apt/trusted.gpg.d
99
+ wget "http://<%= host_content_fqdn %>/pub/pulp_deb_signing.key" -O - | gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/orcharhino_<%= host_content_fqdn %>.gpg --import
100
+ chmod 644 /etc/apt/trusted.gpg.d/orcharhino_<%= host_content_fqdn %>.gpg
101
+ <% # looks like gpg creates this file automatically and there is no option to prevent gpg to create this backup file -%>
102
+ rm -f /etc/apt/trusted.gpg.d/orcharhino_<%= host_content_fqdn %>.gpg~
103
+ <% else %>
104
+ wget "http://<%= host_content_fqdn %>/pub/pulp_deb_signing.key" -O - | apt-key add -
105
+ <% end %>
106
+
107
+ <%- if host_param('kt_activation_keys') -%>
108
+
109
+ cat > /etc/apt/sources.list.d/orcharhino.list <<'EOF'
110
+ # This File is automatically generated.
111
+ # !!! Do not edit !!!
112
+
113
+ deb <%= or_client_repo_url %> default all
114
+ EOF
115
+
116
+ <%= apt_update %>
117
+ <%= apt_install %> apt-transport-katello katello-upload-profile
118
+
119
+ echo "Remove all repositories from /etc/apt/sources.list{,.d/*}"
120
+ cat > /etc/apt/sources.list <<'EOF'
121
+ # This system is managed by orcharhino
122
+ EOF
123
+
124
+ find /etc/apt/sources.list.d -type f -print0 | xargs -r0 rm
125
+
126
+ echo "Registering the System"
127
+ wget --no-check-certificate -O - <%= host_content_url %>/pub/katello-rhsm-consumer | /bin/bash -x 2> /root/katello-rhsm-consumer.log
128
+
129
+ <% if http_proxy %>
130
+ subscription-manager config --server.proxy_hostname='<%= http_proxy %>'
131
+ <% if http_proxy_user %>
132
+ subscription-manager config --server.proxy_user='<%= http_proxy_user %>'
133
+ <% end %>
134
+ <% if http_proxy_password %>
135
+ subscription-manager config --server.proxy_password='<%= http_proxy_password %>'
136
+ <% end %>
137
+ subscription-manager config --server.proxy_port='<%= http_proxy_port %>'
138
+ <% end %>
139
+
140
+ subscription-manager register --org="<%= @host.rhsm_organization_label %>" --name="<%= @host.name %>" --activationkey="<%= host_param('kt_activation_keys') %>"
141
+
142
+ # Update the package lists
143
+ <%= apt_update %>
144
+
145
+ # Install katello host tools and tracer
146
+ if dpkg -l python3-subscription-manager >/dev/null 2>&1; then
147
+ <%= apt_install %> python3-katello-host-tools python3-katello-host-tools-tracer
148
+ else
149
+ <%= apt_install %> python-katello-host-tools python-katello-host-tools-tracer
150
+ fi
151
+
152
+ <% unless host_param_false?('package_upgrade') -%>
153
+ # update all the base packages from the updates repository
154
+ <%= apt_upgrade %>
155
+ <% end -%>
156
+ <%- else -%>
157
+
158
+ cat > /etc/apt/sources.list.d/orcharhino.list <<'EOF'
159
+ # This File is automatically generated.
160
+ # !!! Do not edit !!!
161
+ <%-
162
+ i=1
163
+ while host_param('or_deb_repo_%i' % (i))
164
+ -%>
165
+ deb http://<%= host_content_fqdn %>/<%= host_param('or_deb_repo_%i' % (i)) %>
166
+ <%-
167
+ i = i + 1
168
+ end
169
+ -%>
170
+ EOF
171
+
172
+ <%- end -%>
173
+ <%- else -%>
174
+ echo "Warning! This should only be used on Debian OSes."
175
+ <%- end -%>
@@ -0,0 +1,37 @@
1
+ <%#
2
+ kind: snippet
3
+ name: or_ol_client
4
+ model: ProvisioningTemplate
5
+ snippet: true
6
+ description: This snippet prepares the registration to orcharhino on a OracleLinux host
7
+ -%>
8
+ <%-
9
+ os_major = @host.operatingsystem.major.to_i
10
+
11
+ if !host_param('or_client_repo_url').nil?
12
+ or_client_repo_url = host_param('or_client_repo_url')
13
+ elsif !host_param('or_oraclelinux_client_repo_prefix').nil?
14
+ or_client_repo_url = host_param('or_oraclelinux_client_repo_prefix') + os_major.to_s
15
+ else
16
+ or_client_repo_url = nil
17
+ end
18
+ %>
19
+ <%- if !or_client_repo_url.nil? %>
20
+ # Install dependencies which are required later on while installing the subscription-manager
21
+ yum install -y python-inotify python-setuptools
22
+
23
+ cat << EOF > /etc/yum.repos.d/or_ol_client.repo
24
+ [orcharhino_OracleLinux_Client_<%= os_major %>]
25
+ name=orcharhino Oracle Linux Client
26
+ baseurl="<%= or_client_repo_url %>"
27
+ gpgcheck=0
28
+ enabled=1
29
+ priority=5
30
+ EOF
31
+
32
+ <%- if os_major == 7 %>
33
+ # Remove oracle's rhn-client-tools which blocks the installation of our subscription-manager
34
+ yum remove -y rhn-client-tools
35
+ <%- end %>
36
+
37
+ <%- end %>
@@ -0,0 +1,85 @@
1
+ <%#
2
+ kind: snippet
3
+ name: or_sles_client
4
+ model: ProvisioningTemplate
5
+ snippet: true
6
+ description: this snippet will start a script to register SUSE machines with orcharhino
7
+ %>
8
+ <%
9
+ os_major = @host.operatingsystem.major.to_i
10
+ os_minor = @host.operatingsystem.minor.to_i
11
+ pm_set = @host.puppet_server.present?
12
+ aio_enabled = host_param_true?('enable-puppetlabs-puppet7-repo') || host_param_true?('enable-puppetlabs-puppet5-repo') || host_param_true?('enable-puppetlabs-puppet6-repo') || host_param_true?('enable-puppetlabs-pc1-repo') || host_param_true?('enable-puppet5') || host_param_true?('enable-puppet6') || host_param_true?('enable-puppet7')
13
+ puppet_enabled = pm_set || host_param_true?('force-puppet')
14
+ use_sles_client_v2 = host_param_true?('use-sles-client-v2')
15
+ salt_enabled = host_param('salt_master').present?
16
+ sles_minor_string = (os_minor == 0) ? '' : "SP#{os_minor}"
17
+
18
+ if use_sles_client_v2
19
+ katello_client_tool = "katello-host-tools"
20
+ if os_major >= 15
21
+ katello_client_tool += " katello-host-tools-tracer"
22
+ end
23
+ else
24
+ katello_client_tool = "katello-agent"
25
+ end
26
+
27
+ additional_pkgs=""
28
+ if os_major < 12
29
+ additional_pkgs="libnl3"
30
+ end
31
+ %>
32
+
33
+ <%- if host_param('kt_activation_keys') -%>
34
+ <%- if @host.operatingsystem.family == 'Suse' -%>
35
+ echo "Installing or_sles_client repository"
36
+ <%- if host_param('or_sles_client_repo_prefix').nil? and host_param('or_client_repo_url').nil? -%>
37
+ echo "================================ Warning ============================================="
38
+ echo "Warning: To provision SLES clients, you need to prepare an 'or_sles_client'-repository"
39
+ echo " and write it's location in the operatingsystem parameter 'or_client_repo_url'."
40
+ echo "================================ Warning ============================================="
41
+ <%- end -%>
42
+ <%- if host_param('or_client_repo_url').nil? -%>
43
+ zypper addrepo -G --check "<%= host_param('or_sles_client_repo_prefix') %><%= os_major %><%= sles_minor_string %>" or_sles_client
44
+ <%- else -%>
45
+ zypper addrepo -G --check "<%= host_param('or_client_repo_url') %>" or_sles_client
46
+ <%- end -%>
47
+ zypper -n update
48
+ zypper --non-interactive --no-gpg-checks --quiet install --auto-agree-with-licenses subscription-manager <%= additional_pkgs %>
49
+ <%- unless use_sles_client_v2 -%>
50
+ zypper --non-interactive --no-gpg-checks --quiet install --auto-agree-with-licenses or-sles-client
51
+ <%- end -%>
52
+
53
+ <%- if os_major < 12 -%>
54
+ curl -s <%= subscription_manager_configuration_url(@host, false) %> | bash
55
+ <%- else -%>
56
+ rpm -ivh <%= subscription_manager_configuration_url(@host) %>
57
+ <%- end -%>
58
+ echo "Registering the System"
59
+ subscription-manager register --org="<%= @host.rhsm_organization_label %>" --name="<%= @host.name %>" --activationkey="<%= host_param('kt_activation_keys') %>"
60
+ <% unless host_param_false?('package_upgrade') -%>
61
+ # update all the base packages from the updates repository
62
+ zypper -n update
63
+ <% end -%>
64
+ echo "Installing katello client"
65
+ zypper --non-interactive --no-gpg-checks --quiet install --auto-agree-with-licenses <%= katello_client_tool %>
66
+
67
+ <%- unless use_sles_client_v2 -%>
68
+ chkconfig goferd on
69
+ <%- end -%>
70
+ subscription-manager refresh
71
+
72
+ <% if puppet_enabled -%>
73
+ <% if aio_enabled -%>
74
+ /usr/bin/zypper -n install puppet-agent
75
+ <% else -%>
76
+ /usr/bin/zypper -n install rubygem-puppet
77
+ <% end -%>
78
+ <% end -%>
79
+ <% if salt_enabled -%>
80
+ /usr/bin/zypper -n install salt-minion
81
+ <% end -%>
82
+ <%- else -%>
83
+ echo "Warning! This should only be used on Suse OSes."
84
+ <%- end -%>
85
+ <%- end -%>
@@ -227,7 +227,7 @@ Foreman::Plugin.register :foreman_puppet do
227
227
  end
228
228
  extend_page 'hosts/_list' do |context|
229
229
  context.with_profile :puppet, _('Puppet'), default: true do
230
- add_pagelet :hosts_table_column_header, key: :environment, label: s_('Environment name'), sortable: true, width: '10%', class: 'hidden-xs'
230
+ add_pagelet :hosts_table_column_header, key: :environment, label: s_('Puppet env'), sortable: true, width: '10%', class: 'hidden-xs'
231
231
  add_pagelet :hosts_table_column_content, key: :environment, callback: ->(host) { host.environment }, class: 'hidden-xs ellipsis'
232
232
  end
233
233
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanPuppet
2
- VERSION = '5.0.0'.freeze
2
+ VERSION = '5.1.2'.freeze
3
3
  end
@@ -1,15 +1,5 @@
1
1
  require 'rake/testtask'
2
2
 
3
- # Tasks
4
- namespace :foreman_puppet do
5
- namespace :example do
6
- desc 'Example Task'
7
- task task: :environment do
8
- # Task goes here
9
- end
10
- end
11
- end
12
-
13
3
  # Tests
14
4
  namespace :test do
15
5
  desc 'Test ForemanPuppet'