Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Remove all consul references (#56)
Browse files Browse the repository at this point in the history
* Update provision.sh

* removing threatstack

* Remove all consul references

---------

Co-authored-by: Carlos Olímpio Pires da Cunha Filho <[email protected]>
  • Loading branch information
SaiPrasannaGopularam and carcunha authored Oct 26, 2023
1 parent 6b704ca commit b44942a
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 87 deletions.
6 changes: 0 additions & 6 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ fixtures:
tomcat:
repo: "puppetlabs/tomcat"
ref: "1.4.1"
threatstack:
repo: "threatstack/threatstack"
ref: "2.0.12"
consul:
repo: "KyleAnderson/consul"
ref: "3.2.0"
archive:
repo: "puppet/archive"
ref: "1.3.0"
Expand Down
7 changes: 0 additions & 7 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,10 @@ rk_tomcat::goss::tomcat_group: "%{alias('rk_tomcat::tomcat::tomcat_group')}"
rk_tomcat::goss::tomcat_logdir: "%{alias('rk_tomcat::tomcat::logdir')}"
rk_tomcat::goss::zulu_package: "%{alias('rk_tomcat::java::zulu_package')}"
rk_tomcat::goss::zulu_version: "%{alias('rk_tomcat::java::zulu_version')}"
rk_tomcat::goss::consul_version: "%{alias('rk_tomcat::consul::version')}"

# Fonts
rk_tomcat::fonts::packages:
- ghostscript-chinese
- cjkuni-ukai-fonts
- cjkuni-uming-fonts
- wqy-zenhei-fonts

# threatstack
rk_tomcat::threatstack::deploy_key: keyIsSetBySecretsCommon
rk_tomcat::consul::datacenter: rk-staging-infra
rk_tomcat::consul::tag_key: staging_consul_server
rk_tomcat::consul::version: 1.9.5
13 changes: 10 additions & 3 deletions files/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# set up logging
LOGGER='logger -t [CLOUDINIT] -p daemon.info'

GEMHOME=/usr/local/share/gems

if [[ "${USER}" -ne 0 ]]; then
$LOGGER "$0 must be run as root."
exit 1
Expand Down Expand Up @@ -89,24 +91,26 @@ yum -y install ruby-devel glibc-devel gcc
cat > /root/.gemrc << 'GEMRC'
---
install: --nodocument --bindir /usr/local/bin
update: --nodocument --bindir /usr/local/bin
GEMRC

$LOGGER "Installing Bundler..."
gem install bundler

$LOGGER "Installing Puppet dependencies..."
mkdir -p /etc/puppetlabs/code/modules
export PUPPET_MODULE_DIR='/etc/puppetlabs/code/modules'
yum -y install augeas augeas-devel libxml2-devel

$LOGGER "Installing other gem dependencies..."
BUNDLE=$(which bundle 2>/dev/null || echo '/usr/local/bin/bundle')
$BUNDLE install
$BUNDLE install --verbose

LIBRARIAN_PUPPET=$(which librarian-puppet 2>/dev/null || echo '/usr/local/bin/librarian-puppet')
$LIBRARIAN_PUPPET config path "$PUPPET_MODULE_DIR" --global
$LIBRARIAN_PUPPET install

ln -s /root/rk_tomcat "${PUPPET_MODULE_DIR}/rk_tomcat"
ln -sf /root/rk_tomcat "${PUPPET_MODULE_DIR}/rk_tomcat"

$LOGGER "Running Puppet agent..."
PUPPET_LOGDIR=/var/log/puppet
Expand All @@ -131,7 +135,7 @@ $LOGGER "Disabling Puppet agent..."
$PUPPET resource service puppet ensure=stopped enable=false

$LOGGER "Linking Tomcat homedir to CATALINA_HOME..."
ln -s /usr/share/tomcat /home/tomcat
ln -sf /usr/share/tomcat /home/tomcat


GOSS=$(which goss)
Expand All @@ -155,6 +159,9 @@ else
$LOGGER "Goss not installed, skipping tests."
fi

# masking tomcat updates in yum.conf
echo "exclude=tomcat*" >> /etc/yum.conf

$LOGGER "Removing semaphore..."
$AWS s3 rm "s3://rk-devops-${REGION}/jenkins/semaphores/${INSTANCE_ID}" 2>/dev/null || true

Expand Down
1 change: 0 additions & 1 deletion manifests/goss.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# rk_tomcat::goss
#
class rk_tomcat::goss (
$consul_version,
$version,
$destination,
$catalina_home,
Expand Down
1 change: 0 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
class { 'rk_tomcat::deploy':
require => Class[rk_tomcat::tomcat],
}
class { 'rk_tomcat::threatstack': }

class { 'rk_tomcat::goss::deploy':
require => Class[rk_tomcat::deploy],
Expand Down
19 changes: 0 additions & 19 deletions manifests/threatstack.pp

This file was deleted.

3 changes: 1 addition & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
{"name":"puppetlabs-yumrepo_core","version_requirement":"1.1.0"},
{"name":"saz-limits","version_requirement":"3.0.4"},
{"name":"rehan-wget","version_requirement":"1.6.1"},
{"name":"herculesteam-augeasproviders_sysctl","version_requirement":"2.6.0"},
{"name":"threatstack-threatstack","version_requirement":"2.0.12"}
{"name":"herculesteam-augeasproviders_sysctl","version_requirement":"2.6.0"}
]
}
4 changes: 0 additions & 4 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@
}
end
it { should contain_class('wget')}
it { should contain_class('threatstack').with(
'deploy_key' => 'd3adk3yd3adk3yd3adk3yd3adk3yd3adk3yd3adk3yd3adk3yd3adk3yd3adk3yd3adk3yAA',
)
}
it { should contain_class('rk_tomcat')}
it { should contain_class('rk_tomcat::deploy')}
it { should contain_class('rk_tomcat::tomcat')}
Expand Down
30 changes: 0 additions & 30 deletions spec/classes/threatstack_spec.rb

This file was deleted.

7 changes: 0 additions & 7 deletions spec/fixtures/hieradata/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ rk_tomcat::goss::tomcat_group: "%{alias('rk_tomcat::tomcat::tomcat_group')}"
rk_tomcat::goss::tomcat_logdir: "%{alias('rk_tomcat::tomcat::logdir')}"
rk_tomcat::goss::zulu_package: "%{alias('rk_tomcat::java::zulu_package')}"
rk_tomcat::goss::zulu_version: "%{alias('rk_tomcat::java::zulu_version')}"
rk_tomcat::goss::consul_version: "%{alias('rk_tomcat::consul::version')}"

# Fonts
rk_tomcat::fonts::packages:
Expand All @@ -67,9 +66,3 @@ rk_tomcat::fonts::packages:

rk_tomcat::rsyslog::datahub_host: localhost
rk_tomcat::rsyslog::datahub_port: 1234

# threatstack
rk_tomcat::threatstack::deploy_key: d3adk3yd3adk3yd3adk3yd3adk3yd3adk3yd3adk3yd3adk3yd3adk3yd3adk3yd3adk3yAA
rk_tomcat::consul::datacenter: rk-staging-infra
rk_tomcat::consul::tag_key: staging_consul_server
rk_tomcat::consul::version: 1.9.5
2 changes: 0 additions & 2 deletions templates/99_threatstack.cfg.epp

This file was deleted.

13 changes: 8 additions & 5 deletions templates/provision/gold_master.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# set up logging
LOGGER='logger -t [CLOUDINIT] -p daemon.info'

GEMHOME=/usr/local/share/gems

if [[ "${USER}" -ne 0 ]]; then
$LOGGER "$0 must be run as root."
exit 1
Expand Down Expand Up @@ -69,29 +71,30 @@ fi
cd rk_tomcat

$LOGGER "Configuring RubyGems..."
yum -y install ruby23-devel glibc-devel gcc
yum -y remove ruby20 ruby20-libs
yum -y install ruby-devel glibc-devel gcc
cat > /root/.gemrc << 'GEMRC'
---
install: --nodocument --bindir /usr/local/bin
update: --nodocument --bindir /usr/local/bin
GEMRC

$LOGGER "Installing Bundler..."
gem install bundler

$LOGGER "Installing Puppet dependencies..."
mkdir -p /etc/puppetlabs/code/modules
export PUPPET_MODULE_DIR='/etc/puppetlabs/code/modules'
yum -y install augeas-devel augeas libxml2-devel

$LOGGER "Installing other gem dependencies..."
BUNDLE=$(which bundle 2>/dev/null || echo '/usr/local/bin/bundle')
$BUNDLE install
$BUNDLE install --verbose

LIBRARIAN_PUPPET=$(which librarian-puppet 2>/dev/null || echo '/usr/local/bin/librarian-puppet')
$LIBRARIAN_PUPPET config path "$PUPPET_MODULE_DIR" --global
$LIBRARIAN_PUPPET install

ln -s /root/rk_tomcat "${PUPPET_MODULE_DIR}/rk_tomcat"
ln -sf /root/rk_tomcat "${PUPPET_MODULE_DIR}/rk_tomcat"

$LOGGER "Running Puppet agent..."
mkdir -p /etc/hiera
Expand Down Expand Up @@ -121,7 +124,7 @@ $LOGGER "Disabling Puppet agent..."
$PUPPET resource service puppet ensure=stopped enable=false

$LOGGER "Linking Tomcat homedir to CATALINA_HOME..."
ln -s /usr/share/tomcat /home/tomcat
ln -sf /usr/share/tomcat /home/tomcat

GOSS=$(which goss)
GOSSFILE='./goss.json'
Expand Down

0 comments on commit b44942a

Please sign in to comment.