Skip to content

Commit 518a00e

Browse files
committed
cleanup
1 parent 2baf9be commit 518a00e

File tree

4 files changed

+68
-34
lines changed

4 files changed

+68
-34
lines changed

INSTALL.md

Lines changed: 58 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ example IPA isn't managed and no real route53 keys are provided.
1212
We use Hetzner for cloud instances to test setups:
1313

1414
```
15-
hcloud server create --image=alma-8 --name=lsst.tim.betadots.training --type=cpx41 --ssh-key='bastelfreak betadots'
16-
hcloud server set-rdns lsst.tim.betadots.training --ip=95.217.179.41 --hostname=lsst.tim.betadots.training
17-
hcloud server set-rdns lsst.tim.betadots.training --ip=2a01:4f9:c012:acee::1 --hostname=lsst.tim.betadots.training
15+
hcloud server create --image=alma-8 --name=$host --type=cpx41 --ssh-key='bastelfreak'
16+
hcloud server set-rdns $host --ip=95.217.179.41 --hostname=$host
17+
hcloud server set-rdns $host --ip=2a01:4f9:c012:acee::1 --hostname=$host
1818
```
1919

2020
(Now also add matching A/AAAA records to make this easier)
2121

2222
```
23-
ssh-keygen -f ~/.ssh/known_hosts -R lsst.tim.betadots.training
24-
ssh-keyscan lsst.tim.betadots.training >> ~/.ssh/known_hosts
23+
ssh-keygen -f ~/.ssh/known_hosts -R $host
24+
ssh-keyscan $host >> ~/.ssh/known_hosts
2525
```
2626

2727
## Patching
@@ -45,6 +45,14 @@ mkdir -p ~/.vim/{backupdir,undodir}
4545
wget https://gist.githubusercontent.com/bastelfreak/a3cfa50db2a7be92c47f246f8f22ca5c/raw/dab14889680d4a8bbcb83580185ca2e5040d5947/vla.vimrc -O ~/.vimrc
4646
```
4747

48+
### Helpful tools
49+
50+
Those are helpful during testing
51+
52+
```
53+
dnf -y install htop tig jq
54+
```
55+
4856
## install Puppet + Foreman
4957

5058
```
@@ -59,22 +67,22 @@ dnf -y install puppetdb puppetdb-termini postgresql-contrib
5967
Output from the installer should be like this:
6068

6169
```
62-
[root@lsst ~]# foreman-installer --enable-foreman-plugin-remote-execution --enable-foreman-cli-remote-execution --enable-foreman-proxy-plugin-remote-execution-script
63-
2024-02-11 13:36:41 [NOTICE] [root] Loading installer configuration. This will take some time.
64-
2024-02-11 13:36:43 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
65-
2024-02-11 13:36:43 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
66-
2024-02-11 13:36:44 [NOTICE] [configure] Starting system configuration.
67-
2024-02-11 13:37:40 [NOTICE] [configure] 250 configuration steps out of 1323 steps complete.
68-
2024-02-11 13:37:48 [NOTICE] [configure] 500 configuration steps out of 1326 steps complete.
69-
2024-02-11 13:37:59 [NOTICE] [configure] 750 configuration steps out of 1351 steps complete.
70-
2024-02-11 13:38:00 [NOTICE] [configure] 1000 configuration steps out of 1351 steps complete.
71-
2024-02-11 13:38:17 [NOTICE] [configure] 1250 configuration steps out of 1351 steps complete.
72-
2024-02-11 13:39:33 [NOTICE] [configure] System configuration has finished.
70+
[root@lsst ~]# foreman-installer --enable-foreman-plugin-puppetdb
71+
2024-02-11 18:57:31 [NOTICE] [root] Loading installer configuration. This will take some time.
72+
2024-02-11 18:57:33 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
73+
2024-02-11 18:57:33 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
74+
2024-02-11 18:57:35 [NOTICE] [configure] Starting system configuration.
75+
2024-02-11 18:58:30 [NOTICE] [configure] 250 configuration steps out of 1244 steps complete.
76+
2024-02-11 18:58:39 [NOTICE] [configure] 500 configuration steps out of 1247 steps complete.
77+
2024-02-11 18:58:45 [NOTICE] [configure] 750 configuration steps out of 1272 steps complete.
78+
2024-02-11 18:58:56 [NOTICE] [configure] 1000 configuration steps out of 1272 steps complete.
79+
2024-02-11 19:00:12 [NOTICE] [configure] 1250 configuration steps out of 1272 steps complete.
80+
2024-02-11 19:00:15 [NOTICE] [configure] System configuration has finished.
7381
Executing: foreman-rake upgrade:run
7482
Success!
75-
* Foreman is running at https://lsst.tim.betadots.training
76-
Initial credentials are admin / fbNn4VM4NjA2n2H4
77-
* Foreman Proxy is running at https://lsst.tim.betadots.training:8443
83+
* Foreman is running at https://foreman
84+
Initial credentials are admin / s2hYUi7oEksKxaNM
85+
* Foreman Proxy is running at https://foreman
7886
7987
The full log is at /var/log/foreman-installer/foreman.log
8088
[root@lsst ~]#
@@ -170,7 +178,7 @@ Update Puppetserver to talk to PuppetDB
170178
```
171179
puppet config set --section server storeconfigs true
172180
puppet config set --section main reports foreman,puppetdb
173-
echo -e "[main]\nserver_urls = https://$(hostname -f):8081/\nsoft_write_failure = false" > /etc/puppetlabs/puppet/puppetdb.conf
181+
echo -e "[main]\nserver_urls = https://$(hostname -f):8081/\nsoft_write_failure = true" > /etc/puppetlabs/puppet/puppetdb.conf
174182
systemctl restart puppetserver
175183
```
176184

@@ -179,26 +187,49 @@ systemctl restart puppetserver
179187
We need to ensure foreman knows the environment `bastelfreak` before we can
180188
assign it
181189

182-
* login at https://lsst.tim.betadots.training/
183-
* got to https://lsst.tim.betadots.training/foreman_puppet/environments, import new environments
190+
* login at https://foreman/
191+
* got to https://foreman/foreman_puppet/environments, import new environments
184192

185193
We need to set the environment in foreman
186194

187-
* login at https://lsst.tim.betadots.training/
195+
* login at https://foreman/
188196
* select the node, click edit
189-
* should bring you to https://lsst.tim.betadots.training/hosts/lsst.tim.betadots.training/edit
197+
* should bring you to https://foreman/hosts/foreman/edit
190198
* At environment, select `bastelfreak`
191199
* save
192200

193201
We need to set the role and site
194202

195-
* login at https://lsst.tim.betadots.training/
196-
* At https://lsst.tim.betadots.training/hosts/lsst.tim.betadots.training/edit, go to `Parameters`
203+
* login at https://foreman/
204+
* At https://foreman/hosts/foreman/edit, go to `Parameters`
197205
* Select `Add Parameter`
198206
* Name=site, Value=test; save
199207
* Repeat: Name=role, Value=foreman; save
200208

201209

210+
At the moment a full puppet run doesn't succeed, but we can apply the following tags:
211+
212+
```
213+
puppet agent -t --tags accounts,prometheus,chrony,yumrepo,auditd,tftp,convenience,debugutils,rsyslog,discovery,puppetserver,host,irqbalance,ssh,lldpd,sysstat,r10k,webhook,timezone,selinux,yum,docker,firewall,foreman_envsync,resolv_conf,sudo,postgresql_conf,udevd,reboot.target
214+
```
215+
216+
Due to this we miss some migrations:
217+
218+
```
219+
systemctl restart foreman
220+
foreman-rake db:migrate
221+
```
202222

223+
Then we can reboot:
203224

204-
puppet agent -t --tags accounts,prometheus,chrony,yumrepo,auditd,tftp,convenience,debugutils,rsyslog,discovery,puppetserver,host,irqbalance,ssh,lldpd,sysstat
225+
```
226+
sync; reboot
227+
```
228+
229+
## Rebuilding the instance
230+
231+
```
232+
hcloud server rebuild $host --image=alma-8
233+
ssh-keygen -f ~/.ssh/known_hosts -R $host
234+
ssh-keyscan $host >> ~/.ssh/known_hosts
235+
```

Puppetfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ mod 'stm/debconf', '5.0.0'
112112
mod 'syseleven/restic', '2.6.1'
113113
mod 'theforeman/dhcp', git: 'https://github.com/lsst-it/puppet-dhcp', ref: '4d48173' # https://github.com/theforeman/puppet-dhcp/pull/226
114114
mod 'theforeman/dns', '10.1.0'
115-
mod 'theforeman/foreman', git: 'https://github.com/lsst-it/puppet-foreman', ref: '70b70bc' # 20.2.0 + dep updates
115+
mod 'theforeman/foreman', git: 'https://github.com/theforeman/puppet-foreman', ref: '24.1.0'
116116
mod 'theforeman/foreman_proxy', git: 'https://github.com/lsst-it/puppet-foreman_proxy', ref: '39ef803' # https://github.com/theforeman/puppet-foreman_proxy/pull/772 https://github.com/theforeman/puppet-foreman_proxy/pull/816
117117
mod 'theforeman/puppet', git: 'https://github.com/lsst-it/puppet-puppet', ref: '8ef01c3' # https://github.com/theforeman/puppet-puppet/pull/891
118118
mod 'theforeman/puppetserver_foreman', '2.4.0'

hieradata/role/foreman.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,15 @@ ssh::client_match_block:
200200
StrictHostKeyChecking: "no" # el7 does not support "accept-new"
201201

202202
profile::core::foreman::foreman_config:
203+
# I'm not 100% sure why, but on foreman 3.8/ puppet-foreman 24.1.0 we cannot set booleans
204+
# `/usr/sbin/foreman-rake -- config -k 'bmc_credentials_accessible' -v 'false'` is a workaround
205+
# afterwards puppet detects that the value is correct and doesn't try to change it
203206
bmc_credentials_accessible: {value: false} # disable bmc pass in enc yaml
204207
default_pxe_item_global: {value: "discovery"}
205208
destroy_vm_on_host_delete: {value: true}
206-
discovery_fact_column: {value: "ipmi_ipaddress,ipmi_macaddress"}
207-
discovery_hostname: {value: "ipmi_macaddress,discovery_bootif"}
209+
# on older foreman/puppet-foreman it wasn't idempotent to set this, but it works withforeman 3.8/ puppet-foreman 24.1.0
210+
discovery_fact_column: {value: '["ipmi_ipaddress","ipmi_macaddress"]'}
211+
discovery_hostname: {value: '["ipmi_macaddress","discovery_bootif"]'}
208212
entries_per_page: {value: 100}
209213
# remove "docker*" from default excluded_facts
210214
# XXX using block scalar style results in the double quotes being preceeded
@@ -215,7 +219,9 @@ profile::core::foreman::foreman_config:
215219
#excluded_facts:
216220
# value: '["lo", "en*v*", "usb*", "vnet*", "macvtap*", ";vdsmdummy;", "veth*", "tap*", "qbr*", "qvb*", "qvo*", "qr-*", "qg-*", "vlinuxbr*", "vovsbr*", "br-int", "vif*", "load_averages::*", "memory::swap::available*", "memory::swap::capacity", "memory::swap::used*", "memory::system::available*", "memory::system::capacity", "memory::system::used*", "memoryfree", "memoryfree_mb", "swapfree", "swapfree_mb", "uptime_hours", "uptime_days"]'
217221
host_details_ui: {value: false} # https://projects.theforeman.org/issues/35115
218-
host_power_status: {value: false}
222+
# since isn't required/doesn't work anymore since https://github.com/theforeman/foreman/pull/9462/files
223+
# the option host_power_status doesn't exist in foreman 3.8, I think due to #9462, but that's a bit of a guess
224+
# host_power_status: {value: false}
219225
idle_timeout: {value: 7200} # session timeout in minutes
220226
ignore_puppet_facts_for_provisioning: {value: true}
221227
matchers_inheritance: {value: false}

hieradata/site/test.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
---
2-
# some hacks to get puppet working outside of LSST
3-
ipa::domain_join_password: "foofoofoofoo"
42
resolv_conf::nameservers:
53
- "185.12.64.2"
64
- "185.12.64.1"
@@ -38,5 +36,4 @@ puppetdb::globals::version: '7.16.0'
3836
profile::core::common::manage_sssd: false
3937
profile::core::common::manage_network_manager: false
4038
profile::core::common::manage_krb5: false
41-
# ipa class is still added to the catalog :thinking:
4239
profile::core::common::manage_ipa: false

0 commit comments

Comments
 (0)