SlideShare a Scribd company logo
Getting Started
with CFEngine
Agenda
• Infrastructure Automation with CFEngine
• Theory Concepts
• Software Components
• Language Concepts
• Examples
• Q&A
Productivity
Costs
Security
• Global changes in minutes
• Unlimited scale and complexity
• Remove human bottlenecks
• Reduced need for labor
• Reduced costs related to instability/outages
• Reduced license costs
• Billions of compliance checks per day
• Real-time compliance repairs
• Granular and pattern based
Benefits of Infrastructure Automation
Architected for Speed, Security and Web Scale
1. Define Desired State
2. Ensure
Defined State
CFDB
3. Verify Actual State
Policy-
Server
Design Center
Knowledge Center
CFE Agents
History
• 1993: Open Source project
• 2001: CFEngine version 2
• 2004: Promise Theory
• 2009: CFEngine version 3
• 2014: CFEngine version 3.6
Customer Validation
Technology Validation
• Infrastructure Automation, Continuous Delivery
• Distributed, Lean, Secure architecture
• IT Automation at Web-Scale (size, agility)
• Community (Open source), Enterprise edition
Market Validation
• >10 million servers
• 10,000 companies
• 100 countries
• Tens of thousands of servers (individual
customer deployments)
CFEngine – IT Automation at Web-Scale
CFEngine Enterprise - Mission Portal GUI
Getting Started With CFEngine - Updated Version
- Proprietary and Confidential -
PROMISES
Our Promise – Mashed Potatoes
The Way To Get There - CONVERGENCE
Basic Concepts
• Convergence
• To Converge - To come from different directions to
reach the same point (location, conclusion, etc.)
• Desired state may not be reached on the first pass
• Change can be incremental
• 3 passes over the policy on each run, to accelerate
convergence
• Declarative vs. Imperative
• Declarative is descriptive
• Imperative is sequential
• Promise Theory
Voluntary cooperation between individual, autonomous
actors or agents who publish their intentions to one
another in the form of promises
-- Mark Burgess
The Promise Universe
A Promise Is A Statement of Intention
Promiser Promises to… If not currently kept,
CFEngine will
A variable… …hold a certain value of a
certain type
…store the appropriate value
in the variable
A file …have certain
characteristics
(permissions, ownership,
etc.)
…set the desired properties
on the file
A user account …exist and have certain
characteristics (home
directory, group, etc.)
…create the user account
with the desired
characteristics
A process …be running on the
system
…run the appropriate
command to create the
process
Basic Concepts
• Promise States
• Promise kept ✔
• Promise repaired ✘ → ✔
• Promise not kept ✘ → ✘
SOFTWARE COMPONENTS
Basic Components
Server
cf-serverd
Client
cf-agent
cf-execd
cf-monitord
LANGUAGE COMPONENTS
Anatomy of a Promise
Promise Type
What?
Context
When/Where?
Promiser
Why?
Attributes
How?
Packages:
solaris.tuesday::
“apache”
comment => “Front end webserver”,
package_policy => “add”,
package_version => “2.0”,
package_method => solaris;
Bundles & Bodies
• A bundle is a collection of promises
• For example, a bundle to configure Apache might:
• Install the apache2 package
• Edit the configuration file
• Copy the web server content
• Etc.
• A body is a collection of attributes that
constrains the promise
• Internal (in-line in the promise)
• External (shareable with other promises)
EXAMPLES
Example #1 – File Security
body common control
{
bundlesequence => { "file_security" };
inputs => { "libraries/cfengine_stdlib.cf" };
}
bundle agent file_security {
files:
"/etc/.” -> { “SecurityPolicy513”, “security@cfengine.com” }
handle => "etc_tripwire",
comment => ”Bubble up possible security breaches",
changes => detect_all_change,
depth_search => recurse("inf");
}
Getting Started With CFEngine - Updated Version
Example #2 - MOTD
body common control {
bundlesequence => { "edit_motd" };
inputs => { "libraries/cfengine_stdlib.cf" };
}
bundle agent edit_motd {
vars:
"motd" string => "/etc/motd";
files:
"$(motd)"
create => "true",
edit_line => insert_lines("This system is managed by CFEngine 3"),
handle => "edit_motd",
comment => "Inform sysadmins this system is managed by CFEngine";
}
Getting Started With CFEngine - Updated Version
Example #3 – Install Packages
body common control {
bundlesequence => { "packages" };
inputs => { "libraries/cfengine_stdlib.cf" };
}
bundle agent packages {
packages:
"nano"
handle => "install_nano",
comment => "nano is John's favorite editor",
package_policy => "add", # Ensure that a package is present
package_method => apt;
}
cf-demo# nano
bash: /usr/bin/nano: No such file or directory
cf-demo# cf-agent -f package_add.cf
cf-demo# nano -V
GNU nano version 2.2.6 (compiled 14:12:08, Oct 1 2012)
...
cf-demo#
Example #3 – Install Packages – Cont.
cf-demo#
bash: /usr/bin/nano: No such file or directory
cf-demo# cf-agent -I -f package_add.cf
Q: apt-get update ...:Ign http://dl.google.com stable InRelease
...
Q: apt-get update ...:Hit http://us.archive.ubuntu.com saucy-backports/universe Translation-en
Q: apt-get update ...:Reading package lists...
Q: apt-get update ...:
Q:apt-get --yes instal ...:Reading package lists...
Q:apt-get --yes instal ...:Building dependency tree...
Q:apt-get --yes instal ...:Reading state information...
Q:apt-get --yes instal ...:Suggested packages:
Q:apt-get --yes instal ...: spell
Q:apt-get --yes instal ...:The following NEW packages will be installed:
Q:apt-get --yes instal ...: nano
Q:apt-get --yes instal ...:0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Q:apt-get --yes instal ...:Need to get 0 B/194 kB of archives.
Q:apt-get --yes instal ...:After this operation, 614 kB of additional disk space will be used.
Q:apt-get --yes instal ...:Selecting previously unselected package nano.
Q:apt-get --yes instal ...:(Reading database ... 236090 files and directories currently installed.)
Q:apt-get --yes instal ...:Unpacking nano (from .../nano_2.2.6-1ubuntu1_amd64.deb) ...
Q:apt-get --yes instal ...:Processing triggers for doc-base ...
Q:apt-get --yes instal ...:Processing 2 added doc-base files...
Q:apt-get --yes instal ...:Processing triggers for install-info ...
Q:apt-get --yes instal ...:Processing triggers for man-db ...
Q:apt-get --yes instal ...:Setting up nano (2.2.6-1ubuntu1) ...
Q:apt-get --yes instal ...:update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode
Q:apt-get --yes instal ...:update-alternatives: using /bin/nano to provide /usr/bin/pico (pico) in auto mode
Q:apt-get --yes instal ...:
cf-demo# nano -V
GNU nano version 2.2.6 (compiled 14:12:08, Oct 1 2012)
...
cf-demo#
Example #3 – Install Packages – Cont.
Example #4 – Convergencebundle agent create_user_file {
files:
"/home/cfetest/files/cfe_test_file"
perms => mog("644","cfetest","cfegroup"),
create => "true";
}
bundle agent create_user_directory {
files:
"/home/cfetest/files/."
perms => mog("755","cfetest","cfegroup"),
create => "true";
}
bundle agent adduser {
commands:
"/usr/sbin/useradd cfetest -d /home/cfetest -g cfegroup -m";
}
bundle agent addgroup {
commands:
"/usr/sbin/groupadd -g 1001 cfegroup";
}
body common control {
bundlesequence => { "create_user_file", "create_user_directory", "adduser",
"addgroup" };
inputs => { "/var/cfengine/inputs/libraries/cfengine_stdlib.cf" };
}
2014-03-18T16:46:42+0100 notice: Q: "...in/useradd
cfet": useradd: group 'cfegroup' does not exist
/home/cfetest:
drwxr-xr-x 2 root root 4096 Mar 18 16:46 files
/home/cfetest/files:
-rw-r--r-- 1 root root 0 Mar 18 16:46 cfe_test_file
groups: cfetest: No such user
Example #4 – First Run
/home/cfetest:
drwxr-xr-x 2 root cfegroup 4096 Mar 18 16:46 files
/home/cfetest/files:
-rw-r--r-- 1 root cfegroup 0 Mar 18 16:46 cfe_test_file
cfetest : cfegroup
Example #4 – Second Run
/home/cfetest:
drwxr-xr-x 2 cfetest cfegroup 4096 Mar 18 16:46 files
/home/cfetest/files:
-rw-r--r-- 1 cfetest cfegroup 0 Mar 18 16:46 cfe_test_file
cfetest : cfegroup
Example #4 – Third Run
The agent is at the desired state!
Q & A
• Join the conversation on our community help forum
http://groups.google.com/forum/?fromgroups&hl=en#!forum/help-cfengine
Next Steps
• Learn More check out our documentation
http://cfengine.com/docs/3.5/getting-started.html
• Read Learning CFEngine 3 by Diego Zamboni

More Related Content

What's hot (20)

PDF
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
raccoony
 
PDF
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Dana Luther
 
PDF
10 Million hits a day with WordPress using a $15 VPS
Paolo Tonin
 
PDF
Ansible new paradigms for orchestration
Paolo Tonin
 
PDF
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
謝 宗穎
 
PPT
Build service with_docker_in_90mins
Larry Cai
 
PDF
Developing and Deploying PHP with Docker
Patrick Mizer
 
PDF
Docker presentasjon java bin
Olve Hansen
 
PDF
Docker Basics & Alfresco Content Services
Sujay Pillai
 
PPTX
Dockerizing WordPress
dotCloud
 
PPT
Nuxeo5 - Continuous Integration
PASCAL Jean Marie
 
PPTX
Getting Started with Docker
Geeta Vinnakota
 
PDF
Zero Downtime Deployment with Ansible
Stein Inge Morisbak
 
PDF
이미지 기반의 배포 패러다임 Immutable infrastructure
Daegwon Kim
 
PDF
Zero Downtime Deployment with Ansible
Stein Inge Morisbak
 
PPTX
Installing and running Postfix within a docker container from the command line
dotCloud
 
PDF
Continuous Integration: SaaS vs Jenkins in Cloud
Ideato
 
PDF
Ansible-for-openstack
Udayendu Kar
 
PPTX
One click deployment
Alex Su
 
PPTX
PyWBEM Rapid Overview
SNIATutorials
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
raccoony
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Dana Luther
 
10 Million hits a day with WordPress using a $15 VPS
Paolo Tonin
 
Ansible new paradigms for orchestration
Paolo Tonin
 
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
謝 宗穎
 
Build service with_docker_in_90mins
Larry Cai
 
Developing and Deploying PHP with Docker
Patrick Mizer
 
Docker presentasjon java bin
Olve Hansen
 
Docker Basics & Alfresco Content Services
Sujay Pillai
 
Dockerizing WordPress
dotCloud
 
Nuxeo5 - Continuous Integration
PASCAL Jean Marie
 
Getting Started with Docker
Geeta Vinnakota
 
Zero Downtime Deployment with Ansible
Stein Inge Morisbak
 
이미지 기반의 배포 패러다임 Immutable infrastructure
Daegwon Kim
 
Zero Downtime Deployment with Ansible
Stein Inge Morisbak
 
Installing and running Postfix within a docker container from the command line
dotCloud
 
Continuous Integration: SaaS vs Jenkins in Cloud
Ideato
 
Ansible-for-openstack
Udayendu Kar
 
One click deployment
Alex Su
 
PyWBEM Rapid Overview
SNIATutorials
 

Similar to Getting Started With CFEngine - Updated Version (20)

PPTX
Getting started with CFEngine - Webinar
CFEngine
 
ODP
Cfengine presentation at the RMLL
RUDDER
 
PDF
CFEngine 3
Brian Repko
 
PPTX
Upgrading from CFEngine2 to CFEngine3 - Webinar Slides
CFEngine
 
ODP
It gilde 20150209
Martin Simons
 
ODP
Releases - CFEngine presentation - Configuration Management Camp 2015
kacfengine
 
PDF
Vagrant & CFEngine - LOPSA East 2013
Nick Anderson
 
ODP
cfengine3 at #lspe
Chris Westin
 
PDF
What is new in CFEngine 3.6
Jonathan Clarke
 
PDF
What is new in CFEngine 3.6
RUDDER
 
PDF
Cfg Mgmtcamp 2015 - Releases
CFEngine
 
PDF
Using Docker in CI process
Grzegorz Godlewski
 
PDF
State of the CFEngine 2018
Nick Anderson
 
PDF
Ohio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngine
Nick Anderson
 
PDF
Cf camp 2019 cfconfig - a new way to manage your cold-fusion engine config
Ortus Solutions, Corp
 
PDF
Deploying software at Scale
Kris Buytaert
 
PPTX
Cfengine 2 Overview
Scott Lackey
 
PDF
Setting up your multiengine environment Apache Railo ColdFusion
ColdFusionConference
 
PDF
Command box
ColdFusionConference
 
PDF
Command box
devObjective
 
Getting started with CFEngine - Webinar
CFEngine
 
Cfengine presentation at the RMLL
RUDDER
 
CFEngine 3
Brian Repko
 
Upgrading from CFEngine2 to CFEngine3 - Webinar Slides
CFEngine
 
It gilde 20150209
Martin Simons
 
Releases - CFEngine presentation - Configuration Management Camp 2015
kacfengine
 
Vagrant & CFEngine - LOPSA East 2013
Nick Anderson
 
cfengine3 at #lspe
Chris Westin
 
What is new in CFEngine 3.6
Jonathan Clarke
 
What is new in CFEngine 3.6
RUDDER
 
Cfg Mgmtcamp 2015 - Releases
CFEngine
 
Using Docker in CI process
Grzegorz Godlewski
 
State of the CFEngine 2018
Nick Anderson
 
Ohio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngine
Nick Anderson
 
Cf camp 2019 cfconfig - a new way to manage your cold-fusion engine config
Ortus Solutions, Corp
 
Deploying software at Scale
Kris Buytaert
 
Cfengine 2 Overview
Scott Lackey
 
Setting up your multiengine environment Apache Railo ColdFusion
ColdFusionConference
 
Command box
devObjective
 
Ad

More from CFEngine (7)

PDF
What's new in CFEngine 3.12
CFEngine
 
PPTX
15 most valuable reports with CFEngine
CFEngine
 
PDF
Config Management Camp 2015 - How to Deploy CFEngine in the Open Internet
CFEngine
 
PPTX
Webinar: Drive Financial Services Innovation Through IT Automation
CFEngine
 
PPTX
Introduction to CFEngine Enterprise 3.6.0 Webinar
CFEngine
 
PPTX
IT Automation With CFEngine - Business Value and Basic Concepts
CFEngine
 
PDF
CFEngine Presentation at Taos
CFEngine
 
What's new in CFEngine 3.12
CFEngine
 
15 most valuable reports with CFEngine
CFEngine
 
Config Management Camp 2015 - How to Deploy CFEngine in the Open Internet
CFEngine
 
Webinar: Drive Financial Services Innovation Through IT Automation
CFEngine
 
Introduction to CFEngine Enterprise 3.6.0 Webinar
CFEngine
 
IT Automation With CFEngine - Business Value and Basic Concepts
CFEngine
 
CFEngine Presentation at Taos
CFEngine
 
Ad

Recently uploaded (20)

PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
July Patch Tuesday
Ivanti
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Python basic programing language for automation
DanialHabibi2
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 

Getting Started With CFEngine - Updated Version

  • 2. Agenda • Infrastructure Automation with CFEngine • Theory Concepts • Software Components • Language Concepts • Examples • Q&A
  • 3. Productivity Costs Security • Global changes in minutes • Unlimited scale and complexity • Remove human bottlenecks • Reduced need for labor • Reduced costs related to instability/outages • Reduced license costs • Billions of compliance checks per day • Real-time compliance repairs • Granular and pattern based Benefits of Infrastructure Automation
  • 4. Architected for Speed, Security and Web Scale 1. Define Desired State 2. Ensure Defined State CFDB 3. Verify Actual State Policy- Server Design Center Knowledge Center CFE Agents
  • 5. History • 1993: Open Source project • 2001: CFEngine version 2 • 2004: Promise Theory • 2009: CFEngine version 3 • 2014: CFEngine version 3.6 Customer Validation Technology Validation • Infrastructure Automation, Continuous Delivery • Distributed, Lean, Secure architecture • IT Automation at Web-Scale (size, agility) • Community (Open source), Enterprise edition Market Validation • >10 million servers • 10,000 companies • 100 countries • Tens of thousands of servers (individual customer deployments) CFEngine – IT Automation at Web-Scale
  • 6. CFEngine Enterprise - Mission Portal GUI
  • 8. - Proprietary and Confidential -
  • 10. Our Promise – Mashed Potatoes
  • 11. The Way To Get There - CONVERGENCE
  • 12. Basic Concepts • Convergence • To Converge - To come from different directions to reach the same point (location, conclusion, etc.) • Desired state may not be reached on the first pass • Change can be incremental • 3 passes over the policy on each run, to accelerate convergence • Declarative vs. Imperative • Declarative is descriptive • Imperative is sequential
  • 13. • Promise Theory Voluntary cooperation between individual, autonomous actors or agents who publish their intentions to one another in the form of promises -- Mark Burgess
  • 15. A Promise Is A Statement of Intention Promiser Promises to… If not currently kept, CFEngine will A variable… …hold a certain value of a certain type …store the appropriate value in the variable A file …have certain characteristics (permissions, ownership, etc.) …set the desired properties on the file A user account …exist and have certain characteristics (home directory, group, etc.) …create the user account with the desired characteristics A process …be running on the system …run the appropriate command to create the process
  • 16. Basic Concepts • Promise States • Promise kept ✔ • Promise repaired ✘ → ✔ • Promise not kept ✘ → ✘
  • 20. Anatomy of a Promise Promise Type What? Context When/Where? Promiser Why? Attributes How? Packages: solaris.tuesday:: “apache” comment => “Front end webserver”, package_policy => “add”, package_version => “2.0”, package_method => solaris;
  • 21. Bundles & Bodies • A bundle is a collection of promises • For example, a bundle to configure Apache might: • Install the apache2 package • Edit the configuration file • Copy the web server content • Etc. • A body is a collection of attributes that constrains the promise • Internal (in-line in the promise) • External (shareable with other promises)
  • 23. Example #1 – File Security body common control { bundlesequence => { "file_security" }; inputs => { "libraries/cfengine_stdlib.cf" }; } bundle agent file_security { files: "/etc/.” -> { “SecurityPolicy513”, “[email protected]” } handle => "etc_tripwire", comment => ”Bubble up possible security breaches", changes => detect_all_change, depth_search => recurse("inf"); }
  • 25. Example #2 - MOTD body common control { bundlesequence => { "edit_motd" }; inputs => { "libraries/cfengine_stdlib.cf" }; } bundle agent edit_motd { vars: "motd" string => "/etc/motd"; files: "$(motd)" create => "true", edit_line => insert_lines("This system is managed by CFEngine 3"), handle => "edit_motd", comment => "Inform sysadmins this system is managed by CFEngine"; }
  • 27. Example #3 – Install Packages body common control { bundlesequence => { "packages" }; inputs => { "libraries/cfengine_stdlib.cf" }; } bundle agent packages { packages: "nano" handle => "install_nano", comment => "nano is John's favorite editor", package_policy => "add", # Ensure that a package is present package_method => apt; }
  • 28. cf-demo# nano bash: /usr/bin/nano: No such file or directory cf-demo# cf-agent -f package_add.cf cf-demo# nano -V GNU nano version 2.2.6 (compiled 14:12:08, Oct 1 2012) ... cf-demo# Example #3 – Install Packages – Cont.
  • 29. cf-demo# bash: /usr/bin/nano: No such file or directory cf-demo# cf-agent -I -f package_add.cf Q: apt-get update ...:Ign http://dl.google.com stable InRelease ... Q: apt-get update ...:Hit http://us.archive.ubuntu.com saucy-backports/universe Translation-en Q: apt-get update ...:Reading package lists... Q: apt-get update ...: Q:apt-get --yes instal ...:Reading package lists... Q:apt-get --yes instal ...:Building dependency tree... Q:apt-get --yes instal ...:Reading state information... Q:apt-get --yes instal ...:Suggested packages: Q:apt-get --yes instal ...: spell Q:apt-get --yes instal ...:The following NEW packages will be installed: Q:apt-get --yes instal ...: nano Q:apt-get --yes instal ...:0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded. Q:apt-get --yes instal ...:Need to get 0 B/194 kB of archives. Q:apt-get --yes instal ...:After this operation, 614 kB of additional disk space will be used. Q:apt-get --yes instal ...:Selecting previously unselected package nano. Q:apt-get --yes instal ...:(Reading database ... 236090 files and directories currently installed.) Q:apt-get --yes instal ...:Unpacking nano (from .../nano_2.2.6-1ubuntu1_amd64.deb) ... Q:apt-get --yes instal ...:Processing triggers for doc-base ... Q:apt-get --yes instal ...:Processing 2 added doc-base files... Q:apt-get --yes instal ...:Processing triggers for install-info ... Q:apt-get --yes instal ...:Processing triggers for man-db ... Q:apt-get --yes instal ...:Setting up nano (2.2.6-1ubuntu1) ... Q:apt-get --yes instal ...:update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode Q:apt-get --yes instal ...:update-alternatives: using /bin/nano to provide /usr/bin/pico (pico) in auto mode Q:apt-get --yes instal ...: cf-demo# nano -V GNU nano version 2.2.6 (compiled 14:12:08, Oct 1 2012) ... cf-demo# Example #3 – Install Packages – Cont.
  • 30. Example #4 – Convergencebundle agent create_user_file { files: "/home/cfetest/files/cfe_test_file" perms => mog("644","cfetest","cfegroup"), create => "true"; } bundle agent create_user_directory { files: "/home/cfetest/files/." perms => mog("755","cfetest","cfegroup"), create => "true"; } bundle agent adduser { commands: "/usr/sbin/useradd cfetest -d /home/cfetest -g cfegroup -m"; } bundle agent addgroup { commands: "/usr/sbin/groupadd -g 1001 cfegroup"; } body common control { bundlesequence => { "create_user_file", "create_user_directory", "adduser", "addgroup" }; inputs => { "/var/cfengine/inputs/libraries/cfengine_stdlib.cf" }; }
  • 31. 2014-03-18T16:46:42+0100 notice: Q: "...in/useradd cfet": useradd: group 'cfegroup' does not exist /home/cfetest: drwxr-xr-x 2 root root 4096 Mar 18 16:46 files /home/cfetest/files: -rw-r--r-- 1 root root 0 Mar 18 16:46 cfe_test_file groups: cfetest: No such user Example #4 – First Run
  • 32. /home/cfetest: drwxr-xr-x 2 root cfegroup 4096 Mar 18 16:46 files /home/cfetest/files: -rw-r--r-- 1 root cfegroup 0 Mar 18 16:46 cfe_test_file cfetest : cfegroup Example #4 – Second Run
  • 33. /home/cfetest: drwxr-xr-x 2 cfetest cfegroup 4096 Mar 18 16:46 files /home/cfetest/files: -rw-r--r-- 1 cfetest cfegroup 0 Mar 18 16:46 cfe_test_file cfetest : cfegroup Example #4 – Third Run The agent is at the desired state!
  • 34. Q & A
  • 35. • Join the conversation on our community help forum http://groups.google.com/forum/?fromgroups&hl=en#!forum/help-cfengine Next Steps • Learn More check out our documentation http://cfengine.com/docs/3.5/getting-started.html • Read Learning CFEngine 3 by Diego Zamboni