Demystifying the Foreman

Preview:

Citation preview

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

CfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampCfgMgmtCampFebruary 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

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

inuits.eu

The Foreman: usecasesThe Foreman: usecasesThe Foreman: usecasesThe Foreman: usecasesThe Foreman: usecasesThe Foreman: usecasesThe Foreman: usecasesThe Foreman: usecasesThe Foreman: usecasesThe Foreman: usecasesThe Foreman: usecasesThe Foreman: usecasesThe Foreman: usecasesThe Foreman: usecasesThe Foreman: usecasesThe Foreman: usecasesThe Foreman: usecases

• 22222222222222222012-2013: Puppet ReportingI FFFFFFFFFFFFFFFFForeman < 1.0I RRRRRRRRRRRRRRRRReplacement for Puppet Dashboard

• 22222222222222222014-now: Everything!I NNNNNNNNNNNNNNNNNow using Foreman 1.9.3I CCCCCCCCCCCCCCCCContinuously upgrading from 1.3I AAAAAAAAAAAAAAAAAvoiding .0 releasesI FFFFFFFFFFFFFFFFForeman is always patchedI 1111111111111111100% of our patches are upstream!

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

I 99999999999999999 libvirtI 11111111111111111 VMware

• 44444444444444444 locations• 44444444444444444 smart proxies• 33333333333333333 organisations

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

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 rebuildingLicensed under a Creative Commons Attribution 2.0 License

https://www.flickr.com/photos/andrec/3525054487

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

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

Foreman overviewForeman overviewForeman overviewForeman overviewForeman overviewForeman overviewForeman overviewForeman overviewForeman overviewForeman overviewForeman overviewForeman overviewForeman overviewForeman overviewForeman overviewForeman overviewForeman overviewLicensed under a Creative Commons Attribution-ShareAlike 3.0 License

http://theforeman.org

Technologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involvedTechnologies involved

• RRRRRRRRRRRRRRRRRubyI RRRRRRRRRRRRRRRRRuby-on-RailsI HHHHHHHHHHHHHHHHHammer, kafoI AAAAAAAAAAAAAAAAA lot of rubygemsI SSSSSSSSSSSSSSSSStrong relationship with fog

• PPPPPPPPPPPPPPPPPuppetI WWWWWWWWWWWWWWWWWorks best with Puppet 3I UUUUUUUUUUUUUUUUUse the API

• +++++++++++++++++ smart proxies• +++++++++++++++++ plugins

Getting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedGetting startedLicensed under a Creative Commons Attribution 2.0 License

https://www.flickr.com/photos/horiavarlan/4747872021

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 elsewhereto get data

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 foremanvirtualenv ruby193source ruby193/bin/activatepip install rubyenvrubyenv listrubyenv install 1.9.3−p551

Now you have ruby 1.9.3 in your path

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.yamlcp config/database.yml.example config/database.yml

settings.yaml tuning (for dev)settings.yaml tuning (for dev)settings.yaml tuning (for dev)settings.yaml tuning (for dev)settings.yaml tuning (for dev)settings.yaml tuning (for dev)settings.yaml tuning (for dev)settings.yaml tuning (for dev)settings.yaml tuning (for dev)settings.yaml tuning (for dev)settings.yaml tuning (for dev)settings.yaml tuning (for dev)settings.yaml tuning (for dev)settings.yaml tuning (for dev)settings.yaml tuning (for dev)settings.yaml tuning (for dev)settings.yaml tuning (for dev)

:login: false:require_ssl: false:locations_enabled: false:organizations_enabled: false

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 installbundle exec rake db:migratebundle exec rake db:seed

Additional commandsAdditional commandsAdditional commandsAdditional commandsAdditional commandsAdditional commandsAdditional commandsAdditional commandsAdditional commandsAdditional commandsAdditional commandsAdditional commandsAdditional commandsAdditional commandsAdditional commandsAdditional commandsAdditional commands

bundle updatebundle install −−without libvirtbundle exec rake permissions:resetbundle exec rails server

Running testsRunning testsRunning testsRunning testsRunning testsRunning testsRunning testsRunning testsRunning testsRunning testsRunning testsRunning testsRunning testsRunning testsRunning testsRunning testsRunning testsLicensed under a Creative Commons Attribution 2.0 License

https://www.flickr.com/photos/dahlstroms/3945656390

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

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 testbundle exec ruby −Itest test/unit/

host_test.rb

CommunityCommunityCommunityCommunityCommunityCommunityCommunityCommunityCommunityCommunityCommunityCommunityCommunityCommunityCommunityCommunityCommunityLicensed under a Creative Commons Attribution 2.0 License

https://www.flickr.com/photos/design-dog/1322023178

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 onfreenode

• MMMMMMMMMMMMMMMMMailing lists: foreman-users, foreman-devel• TTTTTTTTTTTTTTTTTickets tracker: projects.theforeman.org• gggggggggggggggggithub.com/theforeman• cccccccccccccccccfgmgmtcamp + construction day

Contribution guidelinesContribution guidelinesContribution guidelinesContribution guidelinesContribution guidelinesContribution guidelinesContribution guidelinesContribution guidelinesContribution guidelinesContribution guidelinesContribution guidelinesContribution guidelinesContribution guidelinesContribution guidelinesContribution guidelinesContribution guidelinesContribution guidelines

• tttttttttttttttttheforeman.org > community• tttttttttttttttttheforeman.org > community > handbook• NNNNNNNNNNNNNNNNNot happy? Improve them• gggggggggggggggggithub.com/theforeman/theforeman.org

Pull requests

Pull requestsPull requestsPull requestsPull requestsPull requestsPull requestsPull requestsPull requestsPull requestsPull requestsPull requestsPull requestsPull requestsPull requestsPull requestsPull requestsPull requests

• EEEEEEEEEEEEEEEEEach PR requires:I AAAAAAAAAAAAAAAAA ticket in redmineI AAAAAAAAAAAAAAAAA compliant commit summaryI AAAAAAAAAAAAAAAAA detailed commit message

• IIIIIIIIIIIIIIIIInclude tests (if possible)• SSSSSSSSSSSSSSSSSpeak with other, explain your usecase

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 :-)

ci.theforeman.orgci.theforeman.orgci.theforeman.orgci.theforeman.orgci.theforeman.orgci.theforeman.orgci.theforeman.orgci.theforeman.orgci.theforeman.orgci.theforeman.orgci.theforeman.orgci.theforeman.orgci.theforeman.orgci.theforeman.orgci.theforeman.orgci.theforeman.orgci.theforeman.org

• RRRRRRRRRRRRRRRRRun all the tests against all kind of rubiesand databases

• TTTTTTTTTTTTTTTTTakes about less than hour, depending onthe load

• SSSSSSSSSSSSSSSSSyntax, interface, runy tests, katellointegration

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)

Going deeperGoing deeperGoing deeperGoing deeperGoing deeperGoing deeperGoing deeperGoing deeperGoing deeperGoing deeperGoing deeperGoing deeperGoing deeperGoing deeperGoing deeperGoing deeperGoing deeperLicensed under a Creative Commons Attribution 2.0 License

https://www.flickr.com/photos/128398720@N04/15424266506/

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 Foremancredentials)

• TTTTTTTTTTTTTTTTTry with another compute resource• TTTTTTTTTTTTTTTTTry with another piece of hardware

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 inforeman-installer-modulesync

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 iscoming)

• BBBBBBBBBBBBBBBBBlog posts• TTTTTTTTTTTTTTTTTriage pending pull requests

ConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionLicensed under a Creative Commons Attribution 2.0 License

https://www.flickr.com/photos/mtaphotos/11200079265

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

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

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

LinksLinksLinksLinksLinksLinksLinksLinksLinksLinksLinksLinksLinksLinksLinksLinksLinks

• hhhhhhhhhhhhhhhhhttp://theforeman.org/• hhhhhhhhhhhhhhhhhttp://theforeman.org/blog/• hhhhhhhhhhhhhhhhhttp://theforeman.org/contribute.html• hhhhhhhhhhhhhhhhhttp://theforeman.org/handbook.html•

hhhhhhhhhhhhhhhhhttp://projects.theforeman.org/projects/foreman

Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?Any Question?

ContactContactContactContactContactContactContactContactContactContactContactContactContactContactContactContactContact

Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivottojulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eu@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie

inuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitshttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.eu

info@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.eu+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636

Recommended