Everything is better with salt – even Foreman.
This presentation discusses the use of Salt as a configuration management tool in Foreman. New features of the Salt plugin will also be demonstrated, such as Salt Variables and the Remote Execution Salt Provider.
4. #oscamp
SaltStack
●
Open Source project initiated by
Thomas Hatch committed on 13 Feb 2011
●
Driven by SaltStack Inc, founded Aug 2012
●
Written in python
●
Infrastructure as code: yaml + jinja templates
●
Event driven, full infrastructure management tool
➢
~ 2150 contributors
➢
~ 106.000 commits
➢
~ 320 formulas
10. #oscamp
Foreman & Salt: Features
●
During host provisioning
– Install salt minion
– Configure salt minion
– Auto-accept key of salt minion
●
Configuration
– Import salt states from smart proxies
– Assign salt states to hostgroups / hosts
– Configure salt variables using (global/host/hostgroup) parameters
●
Run state.highstate via foreman task
– Receive salt grains from hosts
– Import salt reports (via cronjob)
– Show salt report
●
Smart Proxy handling: Salt Keys / Autosign
16. #oscamp
Ready to run salt state.highstate?
Host
states
Global /
Host Group /
Host
Parameters
Assign Configure
Report
Use pillars
Grains
Run
state.highstate
Salt Key
Accept
Upload
Assigned states
17. #oscamp
Run Salt by ‘push’
Smart Proxy
Salt Master
smart_proxy_salt
Managed Host
Salt Minion
Push state.highstate
OLD: Salt Run via foreman-task (output only
available in Monitor → Tasks)
salt managed.host
state.highstate
21. #oscamp
WTF, I’m maintainer!
●
PR handling
●
A lot of more tests in foreman_salt
●
Tests for smart_proxy_salt
●
Fixes + rubocop
Unit tests
Integration tests
UI tests
22. #oscamp
Challenge accepted!
Hard to configure salt pillar data
Uploading the salt report happens only every 10
minutes by a cronjob
No Salt Remote Execution Provider for using salt to
run jobs (shell, state.highstate, and other
salt.modules.* methods)
23. #oscamp
New: run state.highstate by ‘pull’
Smart Proxy
Salt Master
smart_proxy_salt
Managed Host
Salt Minion
Run state.highstate (and other) via
Remote Execution
Why:
- use salt-ssh
- see job progress / output
salt-call state.highstate
Pull state.highstate
26. #oscamp
New: Salt Remote Execution Provider
●
Thanks to Adam Růžička
●
Use salt to execute (every) Remote Execution Job
●
Run state.highstate on one/multiple salt minions
30. #oscamp
New: Salt Variables
Salt variables similar to puppet / ansible
variables
Why:
- Variable types
- Overwrite values by ‘matchers’
- More user-friendly