Skip to content

Commit

Permalink
Merge pull request #10 from betadots/centos8
Browse files Browse the repository at this point in the history
documentation for centos8
  • Loading branch information
tuxmea authored Jan 31, 2022
2 parents 90a98c0 + bc89873 commit 02b6782
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Add required packages
Now one can clone the hdm repository:

cd
git clone https://github.com/example42/hdm.git
git clone https://github.com/betadots/hdm.git
cd hdm/

install gems
Expand Down
48 changes: 43 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# HDM - Hiera Data Manager

Copyright 2022 betadots GmbH
Copyright 2021 example42 GmbH

This Rails application displays [Puppet](https://github.com/puppetlabs/puppet) Hiera data and offers a WebGUI to read/update/create that configuration.
Expand All @@ -12,7 +13,7 @@ A fresh installation needs an admin which has to be created first with the WebGU

## Setup

At the moment setup is ony tested on Mac OS and CentOS 7.
At the moment setup is ony tested on Mac OS and CentOS 7 and 8.

### Mac OS

Expand Down Expand Up @@ -44,7 +45,7 @@ This will provide us with an up to date Ruby version.
```
yum install -y https://kojipkgs.fedoraproject.org//packages/sqlite/3.8.11/1.fc21/x86_64/sqlite-devel-3.8.11-1.fc21.x86_64.rpm
yum install -y https://kojipkgs.fedoraproject.org//packages/sqlite/3.8.11/1.fc21/x86_64/sqlite-3.8.11-1.fc21.x86_64.rpm
yum install -y gcc-c++ zlib-devel
yum install -y gcc-c++ zlib-devel make
```

- Install Ruby Gems
Expand All @@ -65,12 +66,49 @@ sudo yum install -y yarn
yarn install --check-files
```

### CentOS 8

Install Puppet Agent package from Puppetlabs.

This will provide us with an up to date Ruby version.

Fetch HDM: `git clone https://github.com/betadots/hdm.git`

Switch into HDM directory: `cd hdm`

- Install required packages:

```
dnf install -y gcc-c++ zlib-devel sqlite-devel make
```

- Install Ruby Gems

```
/opt/puppetlabs/puppet/bin/gem install bundler
/opt/puppetlabs/puppet/bin/bundle config set --local path 'vendor'
/opt/puppetlabs/puppet/bin/bundle install
```

- Install NodeJS

```
curl --silent --location https://rpm.nodesource.com/setup_14.x | sudo bash
sudo dnf install -y nodejs
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg
sudo dnf install -y yarn
yarn install --check-files
```


### General HDM Setup

- Create a configuration file using the template: `cp config/hdm.yml.template config/hdm.yml`
- Create the database with `bundle exec rails db:setup`
- Generate a new encrypted credentials file: `echo "test" |EDITOR=vim bundle exec rails credentials:edit` (Note: You may need to adopt this. Never forget to set the `EDITOR` env variable)
- Start the webserver with `bundle exec rails server &`
- Create the database with `/opt/puppetlabs/puppet/bin/bundle exec rails db:setup`
- Generate a new encrypted credentials file: `echo "test" |EDITOR=vim /opt/puppetlabs/puppet/bin/bundle exec rails credentials:edit` (Note: You may need to adopt this. Never forget to set the `EDITOR` env variable)
- Start the webserver with `/opt/puppetlabs/puppet/bin/bundle exec rails server &`
- Expand PATH variable `export PATH=/opt/puppetlabs/puppet/bin:$PATH`
- STart the fake puppetdb process (if configured in hdm.yml) `./bin/fake_puppet_db &`
- Use your browser to open http://localhost:3000

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/files/puppet/generate_nodes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
string_length = 8
hostname = rand(36**string_length).to_s(36)
File.open("nodes/#{hostname}.example42.training_facts.yaml", "w") { |f|
f.write "---\nfqdn: '#{hostname}.example42.training'\nrole: 'hdm_test'\nenv: 'demo'\nzone: 'internal'\n"
f.write "---\nfqdn: '#{hostname}.betadots.training'\nrole: 'hdm_test'\nenv: 'demo'\nzone: 'internal'\n"
}
i += 1
end

0 comments on commit 02b6782

Please sign in to comment.