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

Hackdna/puppet modules #3296

Merged
merged 4 commits into from
Mar 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ supervisord.conf
codekit-config.json
.vagrant/
/deployment/puppet/.librarian/
/deployment/puppet/.tmp/
/deployment/puppet/Puppetfile.lock
/deployment/aws-config/config.yaml
/deployment/aws-config/tags.yaml
Expand Down
3 changes: 1 addition & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "deployment/puppet/manifests"
puppet.manifest_file = "site.pp"
puppet.module_path = "deployment/puppet/modules" # requires modules dir to exist when this file is parsed
puppet.options = "--hiera_config /vagrant/deployment/puppet/hiera.yaml" # to avoid missing file warning
puppet.hiera_config_path = "deployment/puppet/hiera.yaml" # to avoid missing file warning
end

# workaround for services that start on boot before /vagrant is available
Expand Down
9 changes: 7 additions & 2 deletions deployment/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ export DEBIAN_FRONTEND=noninteractive
# print commands and their expanded arguments
set -x

/usr/bin/apt-get clean && /usr/bin/apt-get -qq update && /usr/bin/apt-get -y autoremove
/usr/bin/apt-get clean
/usr/bin/apt-get -qq update
/usr/bin/apt-get -y autoremove

/usr/bin/apt-get -q -y install git htop nmon ruby-dev tree

/usr/bin/gem install librarian-puppet -v 2.2.3 --no-rdoc --no-ri

cd /vagrant/deployment/puppet && librarian-puppet install
cd /vagrant/deployment/puppet
librarian-puppet config path /usr/share/puppet/modules --local
librarian-puppet config tmp /tmp --local
librarian-puppet install
4 changes: 0 additions & 4 deletions deployment/puppet/modules/.gitignore

This file was deleted.

22 changes: 16 additions & 6 deletions deployment/terraform/modules/ec2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,12 @@ export DEBIAN_FRONTEND=noninteractive
# print commands and their expanded arguments
set -x

export PROJECT_ROOT=/srv/refinery-platform

# install dependencies
/usr/bin/apt-get clean && /usr/bin/apt-get -qq update && /usr/bin/apt-get -y autoremove
/usr/bin/apt-get clean
/usr/bin/apt-get -qq update
/usr/bin/apt-get -y autoremove
/usr/bin/apt-get -qq -y install git htop jq nmon puppet ruby-dev tree

# add extra SSH keys from Github
Expand All @@ -163,13 +167,19 @@ for USERNAME in ${join(" ", var.ssh_users)}; do
done >> /home/ubuntu/.ssh/authorized_keys

# clone Refinery Platform repo
mkdir /srv/refinery-platform && chown ubuntu:ubuntu /srv/refinery-platform
su -c 'git clone https://github.com/refinery-platform/refinery-platform.git /srv/refinery-platform' ubuntu
su -c 'cd /srv/refinery-platform && /usr/bin/git checkout -q ${var.git_commit}' ubuntu
mkdir $PROJECT_ROOT
chown ubuntu:ubuntu $PROJECT_ROOT
su -c "git clone https://github.com/refinery-platform/refinery-platform.git $PROJECT_ROOT" ubuntu
su -c "cd $PROJECT_ROOT && /usr/bin/git checkout -q ${var.git_commit}" ubuntu

# configure librarian-puppet
/usr/bin/gem install librarian-puppet -v 2.2.3 --no-rdoc --no-ri
su -c 'cd /srv/refinery-platform/deployment/puppet && /usr/local/bin/librarian-puppet install' ubuntu
cd $PROJECT_ROOT/deployment/puppet
# need to set $HOME: https://github.com/rodjek/librarian-puppet/issues/258
export HOME=/root
/usr/local/bin/librarian-puppet config path /usr/share/puppet/modules --local
/usr/local/bin/librarian-puppet config tmp /tmp --local
/usr/local/bin/librarian-puppet install

# assign Puppet variables
export FACTER_ADMIN_PASSWORD="${var.django_admin_password}"
Expand Down Expand Up @@ -203,7 +213,7 @@ export FACTER_REFINERY_WELCOME_EMAIL_MESSAGE="${var.refinery_welcome_email_messa
export FACTER_USER_FILES_COLUMNS="${var.refinery_user_files_columns}"

# run Puppet
/usr/bin/puppet apply --modulepath=/srv/refinery-platform/deployment/puppet/modules /srv/refinery-platform/deployment/puppet/manifests/site.pp
/usr/bin/puppet apply $PROJECT_ROOT/deployment/puppet/manifests/site.pp
EOF
}

Expand Down