openshift / puppet-openshift_origin

Puppet module to create OpenShift Brokers and Nodes. Can be used to create a full OpenShift Origin deployment.
http://forge.puppetlabs.com/openshift/openshift_origin
Other
45 stars 128 forks source link

cannot ssh and git clone to the app gear #261

Open wiwengweng opened 10 years ago

wiwengweng commented 10 years ago

here [1] is the configuration file I use in ALL-in-one mode. just change the example.com to demo.local, then change the hostname of the server, and run 'puppet apply' After the deployment is finished, I do the post install task, and use rhc to create an app, then it failed to clone the git repo. I have checked the .ssh folder of gear repo , the authorized_keys file exists. Also the /root/.ssh/id_rsa and id_rsa.pub file is present, but when I clone the git repo or ssh to the app gear, system keep asking for the password. So there must be something wrong. And can someone figure out how to config the domain and dns_infrastructure_zone? in the provided puppet script, this two para cannot be the same. Or else, will throw exception like:

Error: Cannot alias File[named infrastructure key] to ["/var/named/openshift.local.key"] at /etc/puppet/modules/openshift_origin/manifests/nameserver.pp:112; resource ["File", "/var/named/openshift.local.key"] already declared at /etc/puppet/modules/openshift_origin/manifests/nameserver.pp:82

[2] is my pp file in puppet.

[1] http://openshift.github.io/documentation/oo_deployment_guide_puppet.html#all-in-one

[2] puppet configuration file: class { 'openshift_origin' : roles => ['msgserver','datastore','nameserver','broker','node'],

Hostname values (all identical)

broker_hostname => 'broker.demo.local', datastore_hostname => 'broker.demo.local', msgserver_hostname => 'broker.demo.local', nameserver_hostname => 'broker.demo.local', node_hostname => 'broker.demo.local',

IP address values (all identical)

broker_ip_addr => '192.168.142.134', nameserver_ip_addr => '192.168.142.134', node_ip_addr => '192.168.142.134', conf_node_external_eth_dev => 'eth0',

RPM sources

install_method => 'yum', repos_base => 'file:///home/wen/openshift_repo', jenkins_repo_base => 'file:///home/wen/jenkins_repo', optional_repo => 'http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/',

OpenShift Config

domain => 'wyl.local', openshift_user1 => 'demo', openshift_password1 => 'sMwNUIUqRkV9he1zRfFiAA', conf_valid_gear_sizes => 'small,medium,large', conf_default_gear_capabilities => 'small,medium', conf_default_gear_size => 'small',

Datastore config

mongodb_port => 27017, mongodb_replicasets => false, mongodb_broker_user => 'openshift', mongodb_broker_password => '9Km0vPS9U9v0h5IowgCyw', mongodb_admin_user => 'admin', mongodb_admin_password => 'NnZqfvTetXoSqfEWaYNzw',

MsgServer config

msgserver_cluster => false, mcollective_user => 'mcollective', mcollective_password => 'pv5bDYXFDkYSLRdI5ywQ',

DNS config

dns_infrastructure_zone => 'demo.local', dns_infrastructure_names => [{ hostname => 'broker.demo.local', ipaddr => '192.168.142.134' }], dns_infrastructure_key => 'UjCNCJgnqJPx6dFaQcWVwDjpEAGQY4Sc2H/llwJ6Rt+0iN8CP0Bm5j5pZsvvhZq7mxx7/MdTBBMWJIA9/yLQYg==', bind_key => 'SgUfFVngIN3M2MfmYpfybJGr0VJ8ldBxY3/xtEQLwBSnJZjCmAeudf0cfmPVPSPYgV8657mDFDOg9KPIyyztzw==', }

sdodson commented 9 years ago

I cannot reproduce this using the latest version of OSE and the latest puppet module. Can you confirm which version of Origin you have in your local repos and that this problem still happens with version 4.1.1 of the puppet module?

We've significantly refactored the DNS management in the puppet module, which includes fixes for infrastructure zones as well.

Here's my attempt to reproduce. I've made minimal changes to your example.

[root@sdodson-all-in-one ~]# puppet module list
dnsdomainname: Unknown host
/etc/puppet/modules
├── arioch-keepalived (v1.0.1)
├── blentz-selinux_types (v0.1.0)
├── duritong-sysctl (v0.0.4)
├── openshift-openshift_origin (v4.1.1)
├── puppetlabs-concat (v1.1.2)
├── puppetlabs-haproxy (v1.1.0)
├── puppetlabs-ntp (v3.3.0)
├── puppetlabs-stdlib (v4.3.2)
└── rharrison-lokkit (v0.5.0)
/usr/share/puppet/modules (no modules installed)

[root@sdodson-all-in-one ~]# cat issue261.pp 
class { openshift_origin:
roles => ['msgserver','datastore','nameserver','broker','node'],

# Hostname values (all identical)
broker_hostname => 'broker.demo.local',
datastore_hostname => 'broker.demo.local',
msgserver_hostname => 'broker.demo.local',
nameserver_hostname => 'broker.demo.local',
node_hostname => 'broker.demo.local',

# IP address values (all identical)
broker_ip_addr => $::ec2_public_ipv4,
nameserver_ip_addr => $::ec2_public_ipv4,
node_ip_addr => $::ec2_public_ipv4,
conf_node_external_eth_dev => 'eth0',

# RPM sources
install_method => 'none',
repos_base => 'file:///home/wen/openshift_repo',
jenkins_repo_base => 'file:///home/wen/jenkins_repo',
optional_repo => 'http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/',

# OpenShift Config
domain => 'wyl.local',
openshift_user1 => 'demo',
openshift_password1 => 'sMwNUIUqRkV9he1zRfFiAA',
conf_valid_gear_sizes => 'small,medium,large',
conf_default_gear_capabilities => 'small,medium',
conf_default_gear_size => 'small',

#cartridges to install really just avoid some carts that don't exist in OSE
install_cartridges => ['cron','diy','haproxy','mongodb','nodejs','perl',
                  'php','postgresql','python','ruby','jenkins',
                  'jenkins-client','mysql'],
install_cartridges_recommended_deps => ['jbossews','nodejs','perl','php','python','ruby'],

# Datastore config
mongodb_port => 27017,
mongodb_replicasets => false,
mongodb_broker_user => 'openshift',
mongodb_broker_password => '9Km0vPS9U9v0h5IowgCyw',
mongodb_admin_user => 'admin',
mongodb_admin_password => 'NnZqfvTetXoSqfEWaYNzw',

# MsgServer config
msgserver_cluster => false,
mcollective_user => 'mcollective',
mcollective_password => 'pv5bDYXFDkYSLRdI5ywQ',

# DNS config
dns_infrastructure_zone => 'demo.local',
dns_infrastructure_names => [{ hostname => 'broker.demo.local', ipaddr => $::ec2_public_ipv4 }],
dns_infrastructure_key => 'UjCNCJgnqJPx6dFaQcWVwDjpEAGQY4Sc2H/llwJ6Rt+0iN8CP0Bm5j5pZsvvhZq7mxx7/MdTBBMWJIA9/yLQYg==',
bind_key => 'SgUfFVngIN3M2MfmYpfybJGr0VJ8ldBxY3/xtEQLwBSnJZjCmAeudf0cfmPVPSPYgV8657mDFDOg9KPIyyztzw==',
}

[root@sdodson-all-in-one ~]# puppet apply issue261.pp 
# puppet runs to completion, no errors
[root@sdodson-all-in-one ~]# oo-admin-ctl-district -c add-node -a -n small
Success for node 'sdodson-all-in-one'!

{"_id"=>"5463c4eb7535cd8321000001",
 "active_servers_size"=>1,
 "available_capacity"=>6000,
 "available_uids"=>"<6000 uids hidden>",
 "created_at"=>2014-11-12 20:36:59 UTC,
 "gear_size"=>"small",
 "max_capacity"=>6000,
 "max_uid"=>6999,
 "name"=>"small",
 "platform"=>"linux",
 "servers"=>
  [{"_id"=>"5463c5277535cd10f4000001",
    "active"=>true,
    "name"=>"sdodson-all-in-one",
    "unresponsive"=>false}],
 "updated_at"=>2014-11-12 20:36:59 UTC,
 "uuid"=>"5463c4eb7535cd8321000001"}
[root@sdodson-all-in-one ~]# oo-admin-ctl-cartridge -c import-node --activate
Importing cartridges from node 'sdodson-all-in-one'.
Updating 20 cartridges ...
5463c57e7535cde896000001 # A jenkins-1 (active)
5463c57e7535cde896000002 # A mysql-5.5 (active)
5463c57e7535cde896000003 # A mysql-5.1 (active)
5463c57e7535cde896000004 # A python-3.3 (active)
5463c57e7535cde896000005 # A python-2.7 (active)
5463c57e7535cde896000006 # A python-2.6 (active)
5463c57e7535cde896000007 # A cron-1.4 (active)
5463c57e7535cde896000008 # A nodejs-0.10 (active)
5463c57e7535cde896000009 # A postgresql-9.2 (active)
5463c57e7535cde89600000a # A postgresql-8.4 (active)
5463c57e7535cde89600000b # A ruby-2.0 (active)
5463c57e7535cde89600000c # A ruby-1.9 (active)
5463c57e7535cde89600000d # A ruby-1.8 (active)
5463c57e7535cde89600000e # A haproxy-1.4 (active)
5463c57e7535cde89600000f # A php-5.4 (active)
5463c57e7535cde896000010 # A php-5.3 (active)
5463c57e7535cde896000011 # A diy-0.1 (active)
5463c57e7535cde896000012 # A perl-5.10 (active)
5463c57e7535cde896000013 # A mongodb-2.4 (active)
5463c57e7535cde896000014 # A jenkins-client-1 (active)
[root@sdodson-all-in-one ~]# rhc app create php-5.4 php-5.4
Application Options
-------------------
Domain:     test
Cartridges: php-5.4
Gear Size:  default
Scaling:    no

Creating application 'php-5.4' ... Application name must contain only alphanumeric characters (a-z, A-Z, or 0-9).
[root@sdodson-all-in-one ~]# rhc app create php54 php-5.4
Application Options
-------------------
Domain:     test
Cartridges: php-5.4
Gear Size:  default
Scaling:    no

Creating application 'php54' ... done

No SSH keys were found. We will generate a pair of keys for you.

    Created: /root/.ssh/id_rsa.pub

Your public SSH key must be uploaded to the OpenShift server to access code.  Upload now? (yes|no) yes

Since you do not have any keys associated with your OpenShift account, your new key will be uploaded as the 'default' key.

Uploading key 'default' ... done

Waiting for your DNS name to be available ... done

Initialized empty Git repository in /root/php54/.git/
The authenticity of host 'php54-test.wyl.local (10.3.11.174)' can't be established.
RSA key fingerprint is 41:f8:35:37:7b:ef:2e:1c:d2:59:b4:b0:99:32:80:2f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'php54-test.wyl.local,10.3.11.174' (RSA) to the list of known hosts.

Your application 'php54' is now available.

  URL:        http://php54-test.wyl.local/
  SSH to:     5463c5927535cd7681000006@php54-test.wyl.local
  Git remote: ssh://5463c5927535cd7681000006@php54-test.wyl.local/~/git/php54.git/
  Cloned to:  /root/php54

Run 'rhc show-app php54' for more details about your app.
[root@sdodson-all-in-one ~]# rhc ssh php54
Connecting to 5463c5927535cd7681000006@php54-test.wyl.local ...

    *********************************************************************

    You are accessing a service that is for use only by authorized users.
    If you do not have authorization, discontinue use at once.
    Any use of the services is subject to the applicable terms of the
    agreement which can be found at:
    https://www.openshift.com/legal

    *********************************************************************

    Welcome to OpenShift shell

    This shell will assist you in managing OpenShift applications.

    !!! IMPORTANT !!! IMPORTANT !!! IMPORTANT !!!
    Shell access is quite powerful and it is possible for you to
    accidentally damage your application.  Proceed with care!
    If worse comes to worst, destroy your application with "rhc app delete"
    and recreate it
    !!! IMPORTANT !!! IMPORTANT !!! IMPORTANT !!!

    Type "help" for more info.

[php54-test.wyl.local 5463c5927535cd7681000006]\>