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

documentation for centos8 #10

Merged
merged 1 commit into from
Jan 31, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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