On 20/01/12 12:35 -0500, Mo Morsi wrote:
> meant to be a standin replacement until we had aeolus-cli which we
> do now
Mo, this looks reasonable, but I was unable to apply, could you please
rebase and resend so I can test it out for you? doing a git am got
me:
Applying: BZ #740089: remove interactive mode for the time being
error: patch failed: recipes/aeolus/manifests/profiles/custom.pp:1
error: recipes/aeolus/manifests/profiles/custom.pp: patch does not
apply
Patch failed at 0001 BZ #740089: remove interactive mode for the time
being
This was against a fresh pull of the staging branch.
-j
> ---
> bin/aeolus-configure | 13 +--
> conf/custom_configure | 7 -
> recipes/aeolus/cli.rb | 200
> ---------------------------
> recipes/aeolus/manifests/profiles/custom.pp | 45 ------
> 4 files changed, 1 insertions(+), 264 deletions(-)
> delete mode 100644 conf/custom_configure
> delete mode 100644 recipes/aeolus/cli.rb
> delete mode 100644 recipes/aeolus/manifests/profiles/custom.pp
>
> diff --git a/bin/aeolus-configure b/bin/aeolus-configure
> index 1fa1f9f..6fa83b3 100755
> --- a/bin/aeolus-configure
> +++ b/bin/aeolus-configure
> @@ -19,13 +19,12 @@ usage()
> cat << EOF
>
> USAGE:
> -aeolus-configure [-d|--debug] [-h|--help] [-v|--verbose]
> [-i|--interactive] [-p|--profile]
> +aeolus-configure [-d|--debug] [-h|--help] [-v|--verbose] [-p|--profile]
>
> OPTIONS:
> -h | --help Show this message.
> -d | --debug Debug logging mode.
> -v | --verbose Verbose logging mode.
> - -i | --interactive Interactive installer.
> -p | --profile Name of profile to use. A comma separated list
> can be used to specify multiple profiles.
> EOF
> }
> @@ -47,22 +46,12 @@ while true ; do
> -h|--help) usage ; exit 1 ; shift ;;
> -d|--debug) LOGLEVEL="--debug" ; shift ;;
> -v|--verbose) LOGLEVEL="--verbose" ; shift ;;
> - -i|--interactive) INTERACTIVE=0 ; shift ;;
> -p|--profile) PUPPET_NODE=$2 ; shift ; shift ;;
> --) shift ; break ;;
> *) usage ; exit 1 ;;
> esac
> done
>
> -if [[ $INTERACTIVE -eq 0 ]] ; then
> -PUPPET_NODE='custom'
> -/usr/bin/ruby /usr/share/aeolus-configure/modules/aeolus/cli.rb
> -if [ $? == 1 ] ; then
> -echo
> -exit
> -fi
> -fi
> -
> echo "Launching aeolus configuration recipe..."
>
> export FACTER_AEOLUS_ENABLE_HTTPS=true
> diff --git a/conf/custom_configure b/conf/custom_configure
> deleted file mode 100644
> index 1e7f7aa..0000000
> --- a/conf/custom_configure
> +++ /dev/null
> @@ -1,7 +0,0 @@
> ----
> -parameters:
> - enable_https: true
> - enable_security: false
> -classes:
> -CUSTOM_CLASSES
> -- aeolus::profiles::custom
> diff --git a/recipes/aeolus/cli.rb b/recipes/aeolus/cli.rb
> deleted file mode 100644
> index f12aebd..0000000
> --- a/recipes/aeolus/cli.rb
> +++ /dev/null
> @@ -1,200 +0,0 @@
> -# Interactive aeolus configure installation utility.
> -# Prompt the user for provider account and instance values and write
> them
> -# to a new puppet config files
> -
> -# Copyright 2011 Red Hat, Inc.
> -#
> -# Licensed under the Apache License, Version 2.0 (the "License");
> -# you may not use this file except in compliance with the License.
> -# You may obtain a copy of the License at
> -#
> -#
http://www.apache.org/licenses/LICENSE-2.0
> -#
> -# Unless required by applicable law or agreed to in writing, software
> -# distributed under the License is distributed on an "AS IS" BASIS,
> -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> -# See the License for the specific language governing permissions and
> -# limitations under the License.
> -
> -require 'rubygems'
> -require 'highline/import'
> -
> -puts "Press ^C at any time to terminate"
> -Signal.trap("INT") do
> - exit 1
> -end
> -
> -def clear_screen
> - print "\e[H\e[2J"
> - true
> -end
> -
> -NODE_YAML='/etc/aeolus-configure/nodes/custom_configure'
> -IMAGE_TEMPLATE='/etc/aeolus-configure/custom_template.tdl'
>
-PROFILE_RECIPE='/usr/share/aeolus-configure/modules/aeolus/manifests/profiles/custom.pp'
>
> -
> -
> -installed_component = nil
> -install_components = ["- aeolus::conductor"]
> -component_options = [:"Select All Components", :"Finish
Selection",
> - :"Select Image Factory", :"Select Image
> Warehouse"]
> -all_option,none_option,imagefactory_option, image_warehouse_option =
> *component_options
> -while ![none_option, all_option].include?(installed_component)
> - clear_screen
> - say "Select Aeolus Components to Install"
> - installed_component =
> - choose do |menu|
> - menu.prompt = "Install Aeolus Component: "
> - component_options.each { |op|
> - menu.choice op
> - }
> - end
> - if installed_component == imagefactory_option
> - install_components << "- aeolus::image-factory"
> - elsif installed_component == image_warehouse_option
> - install_components << "- aeolus::iwhd"
> - elsif installed_component == :All
> - install_components << "- aeolus::conductor" <<
> - "- aeolus::image-factory" <<
> - "- aeolus::iwhd"
> - end
> -end
> -
> -providers = []
> -profile=''
> -profile_requires = []
> -profile_packages = ''
> -profile_repos = ''
> -
> -if install_components.include? "- aeolus::conductor"
> - provider_port = 3001
> - while clear_screen && agree("Add provider (y/n)? ")
> - name = ask("Cloud provider label: ") { |q|
> - q.validate = /^[a-zA-Z0-9_-]+$/
> - q.responses[:not_valid] = "Invalid label (must be
> alphanumeric). Cloud provider label: "
> - }
> - type = choose do |menu|
> - menu.prompt = "Cloud provider type: "
> - menu.choice :mock
> - menu.choice :ec2
> - menu.choice :rackspace
> - menu.choice :rhevm
> - menu.choice :vsphere
> - end
> - providers << [name,type]
> -
> - if type == :mock
> - profile += "aeolus::provider{#{name}:\n" +
> - " type => 'mock',\n" +
> - " port => '#{provider_port += 1}',\n" +
> - " require => Aeolus::Conductor::Login['admin']
> }\n\n" +
> - "aeolus::conductor::provider::account{#{name}:\n" +
> - " provider => 'mock',\n" +
> - " type => 'mock',\n" +
> - " username => 'mockuser',\n" +
> - " password => 'mockpassword',\n" +
> - " require => Aeolus::Provider['#{name}']
}\n\n"
> - profile_requires << "Aeolus::Provider['#{name}']"
<<
> -
> "Aeolus::Conductor::Provider::Account['#{name}']"
> -
> - elsif type == :rackspace
> - username = ask("Rackspace Username: ")
> - api_key = ask("Rackspace API Key: "){ |q| q.echo = false }
> - profile += "aeolus::provider{#{name}:\n" +
> - " type => 'rackspace',\n" +
> - " port => '#{provider_port += 1}',\n" +
> - " require => Aeolus::Conductor::Login['admin']
> }\n\n" +
> - "aeolus::conductor::provider::account{#{name}:\n" +
> - " provider => '#{name}',\n" +
> - " type => 'rackspace',\n" +
> - " username => '#{username}',\n" +
> - " password => '#{api_key}',\n" +
> - " require => Aeolus::Provider['#{name}']
}\n\n"
> - profile_requires << "Aeolus::Provider['#{name}']"
<<
> -
> "Aeolus::Conductor::Provider::Account['#{name}']"
> -
> -
> - elsif type == :ec2
> - endpoint = ask("EC2 Endpoint: ")
> - access_key = ask("EC2 Access Key: ")
> - secret_access_key = ask("EC2 Secret Access Key: "){ |q|
> q.echo = false }
> - account_id = ask("EC2 Account ID: ")
> - public_cert = ask("EC2 Public Cert: ")
> - private_key = ask("EC2 Private Key: ")
> - profile += "aeolus::provider{#{name}:\n" +
> - " type => 'ec2',\n" +
> - " endpoint => '#{endpoint}',\n" +
> - " port => '#{provider_port += 1}',\n" +
> - " require => Aeolus::Conductor::Login['admin']
> }\n\n" +
> - "aeolus::conductor::provider::account{#{name}:\n" +
> - " provider => '#{name}',\n" +
> - " type => 'ec2',\n" +
> - " username => '#{access_key}',\n" +
> - " password => '#{secret_access_key}',\n" +
> - " account_id => '#{account_id}',\n" +
> - " x509private => '#{private_key}',\n" +
> - " x509public => '#{public_cert}',\n" +
> - " require => Aeolus::Provider['#{name}']
}\n\n"
> - profile_requires << "Aeolus::Provider['#{name}']"
<<
> -
> "Aeolus::Conductor::Provider::Account['#{name}']"
> -
> - end
> - end
> -
> - # TODO change to create image / deploy to providers (which to select)
> - while clear_screen && agree("Deploy an instance to providers
> (y/n)? ")
> - name = ask("Instance name: ")
> - providers.each { |provider|
> - pname,ptype = *provider
> - profile += "aeolus::image{#{pname}-#{name}:\n" +
> - " target => '#{ptype}',\n" +
> - " template => 'custom_template.tdl',\n" +
> - " provider => '#{pname}',\n" +
> - " hwp => '#{ptype == :rackspace ? 'hwp2'
:
> 'hwp1' }',\n" +
> - " require =>
> [Aeolus::Conductor::Provider::Account['#{pname}'],
> Aeolus::Conductor::Hwp['hwp1', 'hwp2']] }\n\n"
> - profile_requires <<
"Aeolus::Image['#{pname}-#{name}']"
> - }
> -
> - while agree("Add package repo to instance (y/n)? ")
> - repo_name = ask("Name: ")
> - repo_uri = ask("URI: ")
> - profile_repos += "<repository name='#{repo_name}'>"
> - profile_repos += "<url>#{repo_uri}</url>"
> - profile_repos +=
"<signed>false</signed></repository>"
> - end
> -
> - while agree("Add package to instance (y/n)? ") do
> - package_name = ask("Package Name: ")
> - profile_packages += "<package name='#{package_name}'
/>"
> - end
> - #
> - # while agree("Add file? ") do
> - # src_location = ask("File Source ")
> - # dst_location = ask("File Destination ")
> - # end
> - #
> - end
> -end
> -
> -
> -# create the profile
> -text = File.read PROFILE_RECIPE
> -File.open(PROFILE_RECIPE, 'w+'){|f|
> - requires = profile_requires.join(',')
> - requires += ", " unless requires == ""
> - f << text.gsub(/#AEOLUS_SEED_DATA_REQUIRES/, requires).
> - gsub(/#AEOLUS_SEED_DATA/, profile)
> -}
> -
> -# create the node yaml
> -text = File.read NODE_YAML
> -File.open(NODE_YAML, 'w+'){|f|
> - f << text.gsub(/CUSTOM_CLASSES/, install_components.join("\n"))
> -}
> -
> -# create the image template
> -text = File.read IMAGE_TEMPLATE
> -File.open(IMAGE_TEMPLATE, 'w+'){|f|
> - f << text.gsub(/<!--AEOLUS_PACKAGE_DATA-->/, profile_packages).
> - gsub(/<!--AEOLUS_REPO_DATA-->/, profile_repos)
> -}
> diff --git a/recipes/aeolus/manifests/profiles/custom.pp
> b/recipes/aeolus/manifests/profiles/custom.pp
> deleted file mode 100644
> index 5ae3bce..0000000
> --- a/recipes/aeolus/manifests/profiles/custom.pp
> +++ /dev/null
> @@ -1,45 +0,0 @@
> -# Copyright 2011 Red Hat, Inc.
> -#
> -# Licensed under the Apache License, Version 2.0 (the "License");
> -# you may not use this file except in compliance with the License.
> -# You may obtain a copy of the License at
> -#
> -#
http://www.apache.org/licenses/LICENSE-2.0
> -#
> -# Unless required by applicable law or agreed to in writing, software
> -# distributed under the License is distributed on an "AS IS" BASIS,
> -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> -# See the License for the specific language governing permissions and
> -# limitations under the License.
> -
> -class aeolus::profiles::custom {
> -
> -aeolus::conductor::site_admin{"admin":
> - email => 'cloudforms(a)redhat.com',
> - password => "password",
> - first_name => 'aeolus',
> - last_name => 'user'}
> -
> -aeolus::conductor::login{"admin": password => "password",
> - require => Aeolus::Conductor::Site_admin['admin']}
> -
> -#AEOLUS_SEED_DATA
> -
> -aeolus::conductor::hwp{"hwp1":
> - memory => "1",
> - cpu => "1",
> - storage => "1",
> - architecture => "x86_64",
> - require => Aeolus::Conductor::Login["admin"] }
> -
> -aeolus::conductor::hwp{"hwp2":
> - memory => "1",
> - cpu => "",
> - storage => "1",
> - architecture => "x86_64",
> - require => Aeolus::Conductor::Login["admin"] }
> -
> -aeolus::conductor::logout{"admin":
> - require => [#AEOLUS_SEED_DATA_REQUIRES
> - Aeolus::Conductor::Hwp["hwp1", "hwp2"]] }
> -}
> --
> 1.7.6.5
>