This talk introduces shortly the Foreman as a software, how to get started with contributing to the Foreman, how to setup a development environment and play with Rails. This talk is targeting people who want to start making contributions to the Foreman or setup quickly a test instance. It was given at Config Management Camp 2016.
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Demystifying the Foreman
1. Demystifying the ForemanDemystifying the ForemanDemystifying the ForemanDemystifying the ForemanDemystifying the ForemanDemystifying the ForemanDemystifying the ForemanDemystifying the ForemanDemystifying the ForemanDemystifying the ForemanDemystifying the ForemanDemystifying the ForemanDemystifying the ForemanDemystifying the ForemanDemystifying the ForemanDemystifying the ForemanDemystifying the Foreman
Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto
CfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCamp
February 1st, 2016February 1st, 2016February 1st, 2016February 1st, 2016February 1st, 2016February 1st, 2016February 1st, 2016February 1st, 2016February 1st, 2016February 1st, 2016February 1st, 2016February 1st, 2016February 1st, 2016February 1st, 2016February 1st, 2016February 1st, 2016February 1st, 2016
2. whoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoami
• Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto
• SysAdmin at InuitsSysAdmin at InuitsSysAdmin at InuitsSysAdmin at InuitsSysAdmin at InuitsSysAdmin at InuitsSysAdmin at InuitsSysAdmin at InuitsSysAdmin at InuitsSysAdmin at InuitsSysAdmin at InuitsSysAdmin at InuitsSysAdmin at InuitsSysAdmin at InuitsSysAdmin at InuitsSysAdmin at InuitsSysAdmin at Inuits
• CentOS / Puppet / The Foreman userCentOS / Puppet / The Foreman userCentOS / Puppet / The Foreman userCentOS / Puppet / The Foreman userCentOS / Puppet / The Foreman userCentOS / Puppet / The Foreman userCentOS / Puppet / The Foreman userCentOS / Puppet / The Foreman userCentOS / Puppet / The Foreman userCentOS / Puppet / The Foreman userCentOS / Puppet / The Foreman userCentOS / Puppet / The Foreman userCentOS / Puppet / The Foreman userCentOS / Puppet / The Foreman userCentOS / Puppet / The Foreman userCentOS / Puppet / The Foreman userCentOS / Puppet / The Foreman user
• Foreman evangelistForeman evangelistForeman evangelistForeman evangelistForeman evangelistForeman evangelistForeman evangelistForeman evangelistForeman evangelistForeman evangelistForeman evangelistForeman evangelistForeman evangelistForeman evangelistForeman evangelistForeman evangelistForeman evangelist
5. Our R&D labOur R&D labOur R&D labOur R&D labOur R&D labOur R&D labOur R&D labOur R&D labOur R&D labOur R&D labOur R&D labOur R&D labOur R&D labOur R&D labOur R&D labOur R&D labOur R&D lab
• 1111111111111111130 hosts
• 111111111111111110 compute resources
99999999999999999 libvirt
11111111111111111 VMware
• 44444444444444444 locations
• 44444444444444444 smart proxies
• 33333333333333333 organisations
6. What we useWhat we useWhat we useWhat we useWhat we useWhat we useWhat we useWhat we useWhat we useWhat we useWhat we useWhat we useWhat we useWhat we useWhat we useWhat we useWhat we use
• PPPPPPPPPPPPPPPPProvisioning
• PPPPPPPPPPPPPPPPPuppet parameters (ENC)
• PPPPPPPPPPPPPPPPPuppet reporting
• AAAAAAAAAAAAAAAAAdvanced networking
• DDDDDDDDDDDDDDDDDNS DHCP TFTP proxies
7. Building and rebuildingBuilding and rebuildingBuilding and rebuildingBuilding and rebuildingBuilding and rebuildingBuilding and rebuildingBuilding and rebuildingBuilding and rebuildingBuilding and rebuildingBuilding and rebuildingBuilding and rebuildingBuilding and rebuildingBuilding and rebuildingBuilding and rebuildingBuilding and rebuildingBuilding and rebuildingBuilding and rebuilding
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/andrec/3525054487
8. Demystifying the Foreman?Demystifying the Foreman?Demystifying the Foreman?Demystifying the Foreman?Demystifying the Foreman?Demystifying the Foreman?Demystifying the Foreman?Demystifying the Foreman?Demystifying the Foreman?Demystifying the Foreman?Demystifying the Foreman?Demystifying the Foreman?Demystifying the Foreman?Demystifying the Foreman?Demystifying the Foreman?Demystifying the Foreman?Demystifying the Foreman?
• FFFFFFFFFFFFFFFFForeman has a large scope
• YYYYYYYYYYYYYYYYYou really need it
• IIIIIIIIIIIIIIIIIt can be scary to patch it in prod
9. What is inside?What is inside?What is inside?What is inside?What is inside?What is inside?What is inside?What is inside?What is inside?What is inside?What is inside?What is inside?What is inside?What is inside?What is inside?What is inside?What is inside?
• FFFFFFFFFFFFFFFFForeman
• SSSSSSSSSSSSSSSSSmart-proxy
• IIIIIIIIIIIIIIIIInstaller (puppet modules)
• CCCCCCCCCCCCCCCCCommunity templates
• PPPPPPPPPPPPPPPPPlugins
• hhhhhhhhhhhhhhhhhammer, hammer-foreman
11. Technologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involved
• RRRRRRRRRRRRRRRRRuby
RRRRRRRRRRRRRRRRRuby-on-Rails
HHHHHHHHHHHHHHHHHammer, kafo
AAAAAAAAAAAAAAAAA lot of rubygems
SSSSSSSSSSSSSSSSStrong relationship with fog
• PPPPPPPPPPPPPPPPPuppet
WWWWWWWWWWWWWWWWWorks best with Puppet 3
UUUUUUUUUUUUUUUUUse the API
• +++++++++++++++++ smart proxies
• +++++++++++++++++ plugins
12. Getting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting started
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/horiavarlan/4747872021
13. Tip for anyoneTip for anyoneTip for anyoneTip for anyoneTip for anyoneTip for anyoneTip for anyoneTip for anyoneTip for anyoneTip for anyoneTip for anyoneTip for anyoneTip for anyoneTip for anyoneTip for anyoneTip for anyoneTip for anyone
• BBBBBBBBBBBBBBBBBackups, backups, backups
• SSSSSSSSSSSSSSSSSometimes we needed a full restore
• SSSSSSSSSSSSSSSSSometimes partial restore
• SSSSSSSSSSSSSSSSSometime importing the backup elsewhere
to get data
14. Your development environmentYour development environmentYour development environmentYour development environmentYour development environmentYour development environmentYour development environmentYour development environmentYour development environmentYour development environmentYour development environmentYour development environmentYour development environmentYour development environmentYour development environmentYour development environmentYour development environment
The basic tools: Ruby(-devel), Git, . . .
git clone https://github.com/theforeman/
foreman
cd foreman
virtualenv ruby193
source ruby193/bin/activate
pip install rubyenv
rubyenv list
rubyenv install 1.9.3−p551
Now you have ruby 1.9.3 in your path
15. Copy and change some filesCopy and change some filesCopy and change some filesCopy and change some filesCopy and change some filesCopy and change some filesCopy and change some filesCopy and change some filesCopy and change some filesCopy and change some filesCopy and change some filesCopy and change some filesCopy and change some filesCopy and change some filesCopy and change some filesCopy and change some filesCopy and change some files
cp config/settings.yaml.example config/settings.yaml
cp config/database.yml.example config/database.yml
17. Install the dependencies and the DBInstall the dependencies and the DBInstall the dependencies and the DBInstall the dependencies and the DBInstall the dependencies and the DBInstall the dependencies and the DBInstall the dependencies and the DBInstall the dependencies and the DBInstall the dependencies and the DBInstall the dependencies and the DBInstall the dependencies and the DBInstall the dependencies and the DBInstall the dependencies and the DBInstall the dependencies and the DBInstall the dependencies and the DBInstall the dependencies and the DBInstall the dependencies and the DB
bundle install
bundle exec rake db:migrate
bundle exec rake db:seed
20. Remove test coverageRemove test coverageRemove test coverageRemove test coverageRemove test coverageRemove test coverageRemove test coverageRemove test coverageRemove test coverageRemove test coverageRemove test coverageRemove test coverageRemove test coverageRemove test coverageRemove test coverageRemove test coverageRemove test coverage
It is slow and eats memory
vi test/test_helper.rb
#require `simplecov '
#SimpleCov.start `rails ' do
# add_group `API', `app/controllers/api'
#end
git update−index −−assume−unchanged test/
test_helper.rb
21. Running all or one testRunning all or one testRunning all or one testRunning all or one testRunning all or one testRunning all or one testRunning all or one testRunning all or one testRunning all or one testRunning all or one testRunning all or one testRunning all or one testRunning all or one testRunning all or one testRunning all or one testRunning all or one testRunning all or one test
bundle exec rake test
bundle exec ruby −Itest test/unit/
host_test.rb
23. Join the communityJoin the communityJoin the communityJoin the communityJoin the communityJoin the communityJoin the communityJoin the communityJoin the communityJoin the communityJoin the communityJoin the communityJoin the communityJoin the communityJoin the communityJoin the communityJoin the community
• IIIIIIIIIIIIIIIIIRC: #theforeman, #theforeman-dev on
freenode
• MMMMMMMMMMMMMMMMMailing lists: foreman-users, foreman-devel
• TTTTTTTTTTTTTTTTTickets tracker: projects.theforeman.org
• gggggggggggggggggithub.com/theforeman
• cccccccccccccccccfgmgmtcamp + construction day
27. Lifecycle of a Pull requestLifecycle of a Pull requestLifecycle of a Pull requestLifecycle of a Pull requestLifecycle of a Pull requestLifecycle of a Pull requestLifecycle of a Pull requestLifecycle of a Pull requestLifecycle of a Pull requestLifecycle of a Pull requestLifecycle of a Pull requestLifecycle of a Pull requestLifecycle of a Pull requestLifecycle of a Pull requestLifecycle of a Pull requestLifecycle of a Pull requestLifecycle of a Pull request
• IIIIIIIIIIIIIIIIIt gets refused by the Foreman bot :-)
• YYYYYYYYYYYYYYYYYou get some feedback
• SSSSSSSSSSSSSSSSSomeone allows tests to run ([test])
• FFFFFFFFFFFFFFFFFix the tests/respond to feedbacks
• PPPPPPPPPPPPPPPPPR gets accepted
• FFFFFFFFFFFFFFFFFix another bug :-)
29. Where to pull requests?Where to pull requests?Where to pull requests?Where to pull requests?Where to pull requests?Where to pull requests?Where to pull requests?Where to pull requests?Where to pull requests?Where to pull requests?Where to pull requests?Where to pull requests?Where to pull requests?Where to pull requests?Where to pull requests?Where to pull requests?Where to pull requests?
• TTTTTTTTTTTTTTTTThere is no master branch
• DDDDDDDDDDDDDDDDDevelop and test against develop branch
• FFFFFFFFFFFFFFFFFM team will backport to stable if needed
• AAAAAAAAAAAAAAAAAsk in the ticket if you need a backport (e.g
#11375)
31. Debugging compute resourcesDebugging compute resourcesDebugging compute resourcesDebugging compute resourcesDebugging compute resourcesDebugging compute resourcesDebugging compute resourcesDebugging compute resourcesDebugging compute resourcesDebugging compute resourcesDebugging compute resourcesDebugging compute resourcesDebugging compute resourcesDebugging compute resourcesDebugging compute resourcesDebugging compute resourcesDebugging compute resources
• TTTTTTTTTTTTTTTTTry with another client (with Foreman
credentials)
• TTTTTTTTTTTTTTTTTry with another compute resource
• TTTTTTTTTTTTTTTTTry with another piece of hardware
32. Contributing to Puppet modulesContributing to Puppet modulesContributing to Puppet modulesContributing to Puppet modulesContributing to Puppet modulesContributing to Puppet modulesContributing to Puppet modulesContributing to Puppet modulesContributing to Puppet modulesContributing to Puppet modulesContributing to Puppet modulesContributing to Puppet modulesContributing to Puppet modulesContributing to Puppet modulesContributing to Puppet modulesContributing to Puppet modulesContributing to Puppet modules
• OOOOOOOOOOOOOOOOOpen pull requests directly
• CCCCCCCCCCCCCCCCCompat with Puppet 3 and 4 (no 2.7)
• FFFFFFFFFFFFFFFFFollow Puppet best practices
• DDDDDDDDDDDDDDDDDiscuss deep changes with foreman-dev
• TTTTTTTTTTTTTTTTTravis/spec skeleton in
foreman-installer-modulesync
33. Non-code contributionNon-code contributionNon-code contributionNon-code contributionNon-code contributionNon-code contributionNon-code contributionNon-code contributionNon-code contributionNon-code contributionNon-code contributionNon-code contributionNon-code contributionNon-code contributionNon-code contributionNon-code contributionNon-code contribution
• JJJJJJJJJJJJJJJJJoin to mailing lists discussions
• JJJJJJJJJJJJJJJJJoin to the IRC channel
• CCCCCCCCCCCCCCCCContribute to the website (release notes!)
• CCCCCCCCCCCCCCCCCommunity templates (e.g bridge support is
coming)
• BBBBBBBBBBBBBBBBBlog posts
• TTTTTTTTTTTTTTTTTriage pending pull requests
35. Foreman is matureForeman is matureForeman is matureForeman is matureForeman is matureForeman is matureForeman is matureForeman is matureForeman is matureForeman is matureForeman is matureForeman is matureForeman is matureForeman is matureForeman is matureForeman is matureForeman is mature
• BBBBBBBBBBBBBBBBBut releases frequently
• DDDDDDDDDDDDDDDDDeep changes happens often
• GGGGGGGGGGGGGGGGGet a test environment if possible
• TTTTTTTTTTTTTTTTThere is room for improvement
36. The community is openThe community is openThe community is openThe community is openThe community is openThe community is openThe community is openThe community is openThe community is openThe community is openThe community is openThe community is openThe community is openThe community is openThe community is openThe community is openThe community is open
• CCCCCCCCCCCCCCCCCome to us and discuss
• YYYYYYYYYYYYYYYYYou are probably not alone
• TTTTTTTTTTTTTTTTThere is work for everyone
• TTTTTTTTTTTTTTTTTake part of decisions
37. Avoid the troublesAvoid the troublesAvoid the troublesAvoid the troublesAvoid the troublesAvoid the troublesAvoid the troublesAvoid the troublesAvoid the troublesAvoid the troublesAvoid the troublesAvoid the troublesAvoid the troublesAvoid the troublesAvoid the troublesAvoid the troublesAvoid the troubles
• UUUUUUUUUUUUUUUUUse RPM/packages: the stack is too big
• SSSSSSSSSSSSSSSSSend your patches upstream
• AAAAAAAAAAAAAAAAA patch not upstreamed slows you down
• IIIIIIIIIIIIIIIIIf it is VERY specific, make a plugin