Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create common pseudo-profile #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions bin/aeolus-node
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,35 @@
require 'yaml'

NODE_DIR='/etc/aeolus-configure/nodes'
ldap_configure_file = File.join(NODE_DIR, 'ldap_configure')
profile_file = File.join(NODE_DIR, ARGV[0])

[ldap_configure_file, profile_file].each do |f|
common_file = case
when ARGV[0].end_with?('_configure')
File.join(NODE_DIR, 'common_configure')
when ARGV[0].end_with?('_cleanup')
File.join(NODE_DIR, 'common_cleanup')
else
STDERR.puts "Unknown profile type for #{ARGV[0]}, " \
"should be one of {configure,cleanup}"
exit!(1)
end

[common_file, profile_file].each do |f|
unless File.exists?(f)
STDERR.puts "No such file or directory - #{f}"
exit!(1)
end
end

begin
ldap = YAML::load_file(ldap_configure_file)['parameters']['enable_ldap']
rescue NoMethodError
STDERR.puts "#{ldap_configure_file} does not contain a value for " \
"'enable_ldap' under the 'parameters' section"
exit!(1)
rescue => e
STDERR.puts e.message
exit!(1)
end

begin
common_params = YAML::load_file(common_file)['parameters']
profile = YAML::load_file(profile_file)
rescue => e
STDERR.puts e.message
exit!(1)
end

profile['parameters'] ||= {}
profile['parameters']['enable_ldap'] = ldap
profile['parameters'] = common_params.merge(profile['parameters'])
puts YAML::dump(profile)


4 changes: 3 additions & 1 deletion conf/ldap_configure → conf/common_cleanup
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
# anyway.)

parameters:
enable_ldap: false
enable_https: true
enable_kerberos: false
enable_security: false
10 changes: 10 additions & 0 deletions conf/common_configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file is included by other top-level profiles. You should not
# use this profile directly (It has no classes so it won't do anything
# anyway.)

parameters:
enable_https: true
enable_kerberos: false
enable_ldap: false
enable_security: false
package_provider: rpm
3 changes: 0 additions & 3 deletions conf/conductor_cleanup
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#conductor-only cleanup specification
---
parameters:
enable_https: true
enable_kerberos: false
enable_security: false
classes:
- aeolus::conductor::disabled
3 changes: 0 additions & 3 deletions conf/default_cleanup
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
#desire and it will take precedence over this.
---
parameters:
enable_https: true
enable_kerberos: false
enable_security: false
# Uncomment these to clean up RHEV
# rhevm_nfs_server: nfs.server.com
# rhevm_nfs_export: /export/export_domain
Expand Down
4 changes: 0 additions & 4 deletions conf/default_configure
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
#configured for kerberos authentication.
---
parameters:
enable_https: true
enable_kerberos: false
enable_security: false
package_provider: rpm
classes:
- aeolus::conductor
- aeolus::image-factory
Expand Down
3 changes: 0 additions & 3 deletions conf/deltacloud_cleanup
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#deltacloud-only cleanup specification
---
parameters:
enable_https: true
enable_kerberos: false
enable_security: false
classes:
- aeolus::deltacloud::disabled
1 change: 0 additions & 1 deletion conf/deltacloud_configure
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
parameters:
package_provider: rpm
classes:
- aeolus::profiles::deltacloud
4 changes: 0 additions & 4 deletions conf/ec2_configure
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# ec2 setup configuration.
---
parameters:
enable_https: true
enable_kerberos: false
enable_security: false
package_provider: rpm
classes:
- aeolus::conductor
- aeolus::image-factory
Expand Down
1 change: 0 additions & 1 deletion conf/imagebuilder_configure
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
parameters:
package_provider: rpm
classes:
- aeolus::image-factory
- aeolus::iwhd
Expand Down
3 changes: 0 additions & 3 deletions conf/imagefactory_cleanup
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#imagefactory-only cleanup specification
---
parameters:
enable_https: true
enable_kerberos: false
enable_security: false
classes:
- aeolus::image-factory::disabled
1 change: 0 additions & 1 deletion conf/imagefactory_configure
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
parameters:
package_provider: rpm
classes:
- aeolus::image-factory
3 changes: 0 additions & 3 deletions conf/iwhd_cleanup
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#iwhd-only cleanup specification
---
parameters:
enable_https: true
enable_kerberos: false
enable_security: false
classes:
- aeolus::iwhd::disabled
4 changes: 0 additions & 4 deletions conf/iwhd_configure
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,5 @@
#intermachine service calls is on the roadmap.
---
parameters:
enable_https: true
enable_kerberos: false
enable_security: false
package_provider: rpm
classes:
- aeolus::iwhd
4 changes: 0 additions & 4 deletions conf/mock_configure
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# mock setup configuration.
---
parameters:
enable_https: true
enable_kerberos: false
enable_security: false
package_provider: rpm
classes:
- aeolus::conductor
- aeolus::image-factory
Expand Down
3 changes: 0 additions & 3 deletions conf/rhevm_cleanup
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#rhevm-only cleanup specification
---
parameters:
enable_https: true
enable_kerberos: false
enable_security: false
package_provider: rpm
classes:
aeolus::profiles::rhevm::disabled:
Expand Down
4 changes: 0 additions & 4 deletions conf/rhevm_configure
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
---
parameters:
enable_https: true
enable_kerberos: false
enable_security: false
package_provider: rpm
classes:
aeolus::conductor:
aeolus::image-factory:
Expand Down
4 changes: 0 additions & 4 deletions conf/vsphere_configure
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
---
parameters:
enable_https: true
enable_kerberos: false
enable_security: false
package_provider: rpm
classes:
aeolus::conductor:
aeolus::image-factory:
Expand Down
1 change: 0 additions & 1 deletion conf/wui_configure
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
parameters:
package_provider: rpm
classes:
- aeolus::conductor
- aeolus::profiles::conductor