From eba9931ba5a0c35366e93ade7f032e0e75fa0237 Mon Sep 17 00:00:00 2001 From: Alexey Khivin Date: Fri, 29 Apr 2016 13:58:27 +0300 Subject: [PATCH] Install project-config by puppet instead of git clone Change-Id: Ib0b564bf5b8e848ed2f7a303675cfe6df16d3297 --- murano-apps/Gerrit/package/Classes/Gerrit.yaml | 1 - murano-apps/Gerrit/package/Resources/scripts/site.pp | 12 ++++++------ .../Jenkins/package/Resources/scripts/site.pp | 7 +++++++ murano-apps/Nodepool/package/Classes/Nodepool.yaml | 1 - .../Nodepool/package/Resources/scripts/site.pp | 6 ++++++ .../SystemConfig/package/Classes/SystemConfig.yaml | 6 +++++- .../SystemConfig/package/Resources/scripts/deploy.sh | 4 ---- murano-apps/Zuul/package/Classes/Zuul.yaml | 2 -- 8 files changed, 24 insertions(+), 15 deletions(-) diff --git a/murano-apps/Gerrit/package/Classes/Gerrit.yaml b/murano-apps/Gerrit/package/Classes/Gerrit.yaml index f53ca0e..bcaaf37 100644 --- a/murano-apps/Gerrit/package/Classes/Gerrit.yaml +++ b/murano-apps/Gerrit/package/Classes/Gerrit.yaml @@ -94,7 +94,6 @@ Methods: Then: - $.createLdapConfiguration() - $.instance.setHieraValue( 'gerrit_war_url', $this.warUrl) - - $.instance.setHieraValue( 'project_config_repo', 'https://review.fuel-infra.org/open-paas/project-config') - $.instance.setHieraValue( 'gerrit_github_token', '') - $.instance.setHieraValue( 'github_project_username', 'mirademo') - $.instance.setHieraValue( 'github_project_password', 'github_project_password') diff --git a/murano-apps/Gerrit/package/Resources/scripts/site.pp b/murano-apps/Gerrit/package/Resources/scripts/site.pp index 7111431..4cff4fe 100644 --- a/murano-apps/Gerrit/package/Resources/scripts/site.pp +++ b/murano-apps/Gerrit/package/Resources/scripts/site.pp @@ -5,6 +5,12 @@ node default { $ldap_dn = domain2dn(hiera("ldap_domain")) $ldap_ip = hiera('ldap_ip') + if ! defined(Class['project_config']) { + class { 'project_config': + url => hiera('project_config_repo'), + } + } + class { 'openstack_project::server': iptables_public_tcp_ports => [80, 443, 8081, 29418], sysadmins => hiera('sysadmins', []), @@ -86,10 +92,4 @@ node default { # user => "puppet", # # } - - if ! defined(Class['project_config']) { - class { 'project_config': - url => hiera('project_config_repo'), - } - } } diff --git a/murano-apps/Jenkins/package/Resources/scripts/site.pp b/murano-apps/Jenkins/package/Resources/scripts/site.pp index 70dc3c3..bdb2e3d 100644 --- a/murano-apps/Jenkins/package/Resources/scripts/site.pp +++ b/murano-apps/Jenkins/package/Resources/scripts/site.pp @@ -1,4 +1,11 @@ node default { + + if ! defined(Class['project_config']) { + class { 'project_config': + url => hiera('project_config_repo'), + } + } + class { 'openstack_project::jenkins': jenkins_password => '', jenkins_ssh_private_key => '', diff --git a/murano-apps/Nodepool/package/Classes/Nodepool.yaml b/murano-apps/Nodepool/package/Classes/Nodepool.yaml index 25551f0..ed68644 100644 --- a/murano-apps/Nodepool/package/Classes/Nodepool.yaml +++ b/murano-apps/Nodepool/package/Classes/Nodepool.yaml @@ -69,7 +69,6 @@ Methods: - $jenkinsHost: $.detectPrimaryIP($.jenkins.instance) - $.instance.setHieraValue('jenkins_host', $jenkinsHost) - detectPrimaryIP: Arguments: - instance: diff --git a/murano-apps/Nodepool/package/Resources/scripts/site.pp b/murano-apps/Nodepool/package/Resources/scripts/site.pp index ef91855..2ea80d4 100644 --- a/murano-apps/Nodepool/package/Resources/scripts/site.pp +++ b/murano-apps/Nodepool/package/Resources/scripts/site.pp @@ -4,6 +4,12 @@ node default { iptables_public_tcp_ports => [80], } + if ! defined(Class['project_config']) { + class { 'project_config': + url => hiera('project_config_repo'), + } + } + class { 'nodepool': mysql_root_password => hiera('nodepool_mysql_root_password'), mysql_password => hiera('nodepool_mysql_password'), diff --git a/murano-apps/SystemConfig/package/Classes/SystemConfig.yaml b/murano-apps/SystemConfig/package/Classes/SystemConfig.yaml index a2d0553..76a69c8 100644 --- a/murano-apps/SystemConfig/package/Classes/SystemConfig.yaml +++ b/murano-apps/SystemConfig/package/Classes/SystemConfig.yaml @@ -6,7 +6,10 @@ Namespaces: puppet: io.murano.opaas.puppet Name: SystemConfig - +Properties: + projectConfigRepo: + Contract: $.string().notNull() + Default: 'https://review.fuel-infra.org/open-paas/project-config' Methods: installOnTheNode: Arguments: @@ -16,3 +19,4 @@ Methods: - $resources: new(sys:Resources) - $template: $resources.yaml('SystemConfig.template') - $instance.agent.call($template, $resources) + - $instance.setHieraValue( 'project_config_repo', $this.projectConfigRepo) \ No newline at end of file diff --git a/murano-apps/SystemConfig/package/Resources/scripts/deploy.sh b/murano-apps/SystemConfig/package/Resources/scripts/deploy.sh index b246405..6f8f543 100644 --- a/murano-apps/SystemConfig/package/Resources/scripts/deploy.sh +++ b/murano-apps/SystemConfig/package/Resources/scripts/deploy.sh @@ -11,10 +11,6 @@ cd system-config cp -r modules/ /etc/puppet/ - -git clone https://review.fuel-infra.org/open-paas/project-config -cp -r project-config/ /etc/ - # Should be installed on the each node to use # domain2dn function puppet module install datacentred-ldap \ No newline at end of file diff --git a/murano-apps/Zuul/package/Classes/Zuul.yaml b/murano-apps/Zuul/package/Classes/Zuul.yaml index 40e0312..8e276d9 100644 --- a/murano-apps/Zuul/package/Classes/Zuul.yaml +++ b/murano-apps/Zuul/package/Classes/Zuul.yaml @@ -19,7 +19,6 @@ Properties: Contract: $.class(puppet:PuppetInstance).notNull() gerrit: Contract: $.class(Gerrit) - Methods: .init: Body: @@ -86,7 +85,6 @@ Methods: Else: - $gerritHost: $gerritInstance.ipAddresses[0] - - $.instance.setHieraValue('project_config_repo', 'https://review.fuel-infra.org/open-paas/project-config') - $.instance.setHieraValue('gerrit_server', $gerritHost) - $.instance.setHieraValue('gerrit_user', 'zuul') - $.instance.setHieraValue('gerrit_ssh_host_key', $.gerrit.instance.getHieraValue('gerrit_ssh_rsa_pubkey_contents'))