Closed sdodson closed 9 years ago
[test]
Origin Test Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests/3030/)
After some discussions with @sosiouxme and @nhr, we should probably do some detection to make sure we aren't changing the frontend on an existing deployment, since it would result in a massivly b0rked node.
tricky part is, we don't care about changing it if there are no applications (hence no frontend config), but we should definitely error out if we would be changing it on a system that had gears configured.
@detiber @sosiouxme how's this look? If you attempt to change the frontend plugin after the first puppet run it will error out before altering node.conf. Expected user action would be to perform migration steps by hand and then remove /etc/openshift/.puppet_node_frontend_plugins though other than documenting that in the puppet code I don't have a great way of conveying that to the user.
It currently looks like this
[root@sdodson-node01 ~]# puppet agent -t
Info: Retrieving plugin
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/pe_build.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/iptables_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/staging_http_get.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/pe_puppetdb_server_status.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/pe_postgres_default_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/facter_dot_d.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/puppet_vardir.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/postgres_default_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/root_home.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/platform_tag.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/pe_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/windows.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/custom_auth_conf.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/iptables_persistent_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/ip6tables_version.rb
Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/concat_basedir.rb
Info: Caching catalog for sdodson-node01.example.com
Warning: The package type's allow_virtual parameter will be changing its default value from false to true in a future release. If you do not want to allow virtual packages, please explicitly set allow_virtual to false.
(at /opt/puppet/lib/ruby/site_ruby/1.9.1/puppet/type.rb:816:in `set_default')
Info: Applying configuration version '1413317941'
Notice: /Stage[main]/Openshift_origin::Node/Exec[prevent_node_frontend_changes]/returns: 1c1
Notice: /Stage[main]/Openshift_origin::Node/Exec[prevent_node_frontend_changes]/returns: < apache-vhostnodejs-websocket
Notice: /Stage[main]/Openshift_origin::Node/Exec[prevent_node_frontend_changes]/returns: ---
Notice: /Stage[main]/Openshift_origin::Node/Exec[prevent_node_frontend_changes]/returns: > apache-mod-rewritenodejs-websocket
Error: /usr/bin/diff /etc/openshift/.puppet_node_frontend_plugins /etc/openshift/.puppet_proposed_node_frontend_plugins returned 1 instead of one of [0]
Error: /Stage[main]/Openshift_origin::Node/Exec[prevent_node_frontend_changes]/returns: change from notrun to 0 failed: /usr/bin/diff /etc/openshift/.puppet_node_frontend_plugins /etc/openshift/.puppet_proposed_node_frontend_plugins returned 1 instead of one of [0]
Notice: /Stage[main]/Openshift_origin::Node/File[openshift node config]: Dependency Exec[prevent_node_frontend_changes] has failures: true
Warning: /Stage[main]/Openshift_origin::Node/File[openshift node config]: Skipping because of failed dependencies
Notice: /Stage[main]/Openshift_origin::Selbooleans::Node/Exec[node restorecon commands]: Dependency Exec[prevent_node_frontend_changes] has failures: true
Warning: /Stage[main]/Openshift_origin::Selbooleans::Node/Exec[node restorecon commands]: Skipping because of failed dependencies
Notice: /Stage[main]/Openshift_origin::Plugins::Container::Selinux/Augeas[update login.defs with min gear uid/gid]: Dependency Exec[prevent_node_frontend_changes] has failures: true
Warning: /Stage[main]/Openshift_origin::Plugins::Container::Selinux/Augeas[update login.defs with min gear uid/gid]: Skipping because of failed dependencies
Notice: /Stage[main]/Openshift_origin::Mcollective_server/Exec[openshift-facts]: Dependency Exec[prevent_node_frontend_changes] has failures: true
Warning: /Stage[main]/Openshift_origin::Mcollective_server/Exec[openshift-facts]: Skipping because of failed dependencies
Notice: /Stage[main]/Openshift_origin::Cartridges::Jenkins/Exec[/usr/bin/yum versionlock jenkins]/returns: executed successfully
Notice: /Stage[main]/Openshift_origin::Mcollective_server/Service[ruby193-mcollective]: Dependency Exec[prevent_node_frontend_changes] has failures: true
Warning: /Stage[main]/Openshift_origin::Mcollective_server/Service[ruby193-mcollective]: Skipping because of failed dependencies
Notice: /Stage[main]/Openshift_origin::Role::Node/Openshift_origin::Register_dns[register node dns]/Exec[Register sdodson-node01.example.com]: Dependency Exec[prevent_node_frontend_changes] has failures: true
Warning: /Stage[main]/Openshift_origin::Role::Node/Openshift_origin::Register_dns[register node dns]/Exec[Register sdodson-node01.example.com]: Skipping because of failed dependencies
Notice: Finished catalog run in 9.63 seconds
[root@sdodson-node01 ~]#
Also, as we found out, if we really want to test this we'll need to make changes to the jenkins jobs as they're setting the node_frontend_plugins.
[test]
Evaluated for origin up to 0c1a9a686debefb53014613e3a9c0c129636c2f5
Enterprise and Origin intend to make apache-vhost the default frontend plugin.