A book for learning puppet by real example and by building code. Second chapters takes you through all basics of Puppet and enough ruby to work with Puppet.
A book for learning puppet by real example and by building code. Third chapter shows a basic use case of installing tomcat and creating a module to do the same.
A book for learning puppet by real example and by building code. Chapter 1 gives you basic introduction and sets you up with a server-agent using Vagrant so that you can do hands-on.
PuppetCamp London fall 2014
Martin Alfke - Can you upgrade to Puppet 4.x?
My talk at PuppetCamp London 2014 taking care on best practices and bad examples and an outlook to Puppet 4.
This document discusses Puppet modules and Example42's approach. It outlines how Example42 develops Puppet modules following best practices for reusability, standardization, and interoperability. Their next generation modules provide features like automatic monitoring, firewalling, and Puppi integration while allowing high levels of customization through parameters.
Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)Robert Nelson
Let's describe the process for upgrading from Puppet 3 to 4, list some common pitfalls and how to avoid them, and be sure to enjoy ourselves in the process!
Puppet is a configuration management tool that allows systems to be declared and maintained in a desired state. It uses a declarative domain-specific language to describe system configuration. Resources are used to model system components like packages, services, files and users. Modules bundle related manifests, files and templates. A Puppet master stores configurations and agents pull configurations from the master to make necessary changes. After runs, agents report back metrics and logs to provide visibility into infrastructure changes.
This document discusses Puppet modules and provides examples of how to structure modules to allow for customization and reuse. It outlines 10 design rules for Example42 modules, including separating configuration data from module logic, providing choices for configuration file supply, configuring with defaults but allowing customization, and allowing management of general module behavior. The document provides code examples demonstrating how to implement these rules in Puppet modules.
Twig: Friendly Curly Braces Invade Your Templates!Ryan Weaver
Video: http://youtu.be/Jikkiqt-nBo
Twig! Yep, it's that fancy magic that's supposed to make theming in Drupal 8 as much fun as eating beef brisket at Rudy's Country Store in Austin (apologies to my veggie friends!). And in fact, Twig was *born* for this: a language that was created with one job in mind: making writing templates awesome and powerful. Oh, and to make you love using it.
In this talk, we'll learn about Twig from the ground-up: syntax, filters, inheritance and other tricks you can learn now to be ready for Drupal 8. We'll also look at how Twig looks inside Drupal, and how it compares to what you're used to in Drupal 7.
By the end, you'll know everything to start getting your Drupal 8 theme on and be shouting its praises from the hills! Ok, maybe not that last part (but I do love how excited Drupalers get), but you'll definitely have a new friend in your world: Twig.
The document discusses new features and changes in Puppet 4, including Puppet Server running on JVM, packaging improvements, environment configuration options, language features like lambdas and HEREDOC support, type validation, and deprecations like node inheritance and hyphens in names. It highlights four key powers of Puppet 4: performance, scalability, measurability, and flexibility in dealing with complex data types natively. Upgrading to Puppet 4 requires changes to comply with deprecations and testing to ensure compatibility.
Hear no evil, see no evil, patch no evil: Or, how to monkey-patch safely.Graham Dumpleton
Python is a dynamic programming language and has a strong tradition of adhering to a programming style called duck-typing. This means that it is possible to easily modify an application's code while it is running. One might wish to do this for various reasons, including enhancing the functionality of code, correcting errant behaviour, or adding instrumentation or debugging code.
Making such code modifications can be tricky though and not done correctly can potentially interfere with the operation of the original code, through destroying introspection abilities, not honouring the duck-typing mantra or due to being applied at the wrong time.
If you do need to do monkey patching though, the 'wrapt' library is your friend, with its transparent object proxy wrappers and post import hook mechanism, it allows you to safely monkey patch code to modify its behaviour.
Learn about the 'wrapt' library and the joys, but also the dangers, of monkey patching.
PECL Picks - Extensions to make your life betterZendCon
This document provides information about various PHP extensions available through PECL (PHP Extension Community Library). It introduces the author and their background, describes what PECL is and provides a brief history. It then discusses the current status of PECL, future plans, and how individuals can get involved. Finally, it highlights and provides code examples for several popular and useful PECL extensions, including APC, Memcache, Imagick, HTTP, UploadProgress and others.
This document discusses using Puppet to program IT infrastructures. It introduces Puppet as a tool for automating infrastructure management and provisioning. Puppet uses a declarative language and allows infrastructure to be coded and version controlled. The document provides an overview of Puppet architecture with Master and Agent nodes and explains how nodes are defined and organized using classes and modules. It also shows examples of Puppet code for configuring common services and managing files and templates.
Getting big without getting fat, in perlDean Hamstead
Thoughts on keeping your perl code lean as your code base gets bigger. Ideas on API structure for plugins and modules which can help. Some recommended option settings and module suggestions for handling configuration. A passing reference to logging.
A variety of pop culture, tech and start up culture references to keep things interesting.
All feedback welcome
Presented 18/08/2015 at Sydney PM
Puppi is a Puppet modules that drives Puppet's knowledge of the Systems to a command line tool that you can use to check services availability, gather info on the system and deploy application with a single command.
PHP is a server-side scripting language used to create dynamic web pages. It allows embedding PHP code within HTML pages and interacting with databases. Key elements of PHP include variables, control structures, functions, and sessions. Sessions store user data on the server instead of the client to avoid cookies and allow tracking users across multiple pages.
This document discusses using PHP for both web and desktop applications. It introduces PHP-GTK, which allows PHP to create graphical desktop applications with a native look and feel across platforms. It provides examples of creating windows, containers, working with signals and the main loop. The document also discusses installing PHP-GTK, some key considerations for desktop applications, and examples of creating widgets like trees and working with models.
- The document discusses various patterns and techniques the author has found useful when working with Puppet modules over 10+ years, including some that may be considered unorthodox or anti-patterns by some.
- Key topics covered include optimization of reusable modules, custom data types, Bolt tasks and plans, external facts, Hiera classification, ensuring resources for presence/absence, application abstraction with Tiny Puppet, and class-based noop management.
- The author argues that some established patterns like roles and profiles can evolve to be more flexible, and that running production nodes in noop mode with controls may be preferable to fully enforcing on all nodes.
Puppet camp2021 testing modules and controlrepoPuppet
This document discusses testing Puppet code when using modules versus a control repository. It recommends starting with simple syntax and unit tests using PDK or rspec-puppet for modules, and using OnceOver for testing control repositories, as it is specially designed for this purpose. OnceOver allows defining classes, nodes, and a test matrix to run syntax, unit, and acceptance tests across different configurations. Moving from simple to more complex testing approaches like acceptance tests is suggested. PDK and OnceOver both have limitations for testing across operating systems that may require customizing spec tests. Infrastructure for running acceptance tests in VMs or containers is also discussed.
- A repo should keep code, config, deploy, and documentation matched through versioning and CI/CD tools. Code should be written for others, not just oneself.
- Documentation serves to explain implementation, purpose, context, decisions, and how components work together. Extended documentation includes code comments, docstrings, tests, commits, dev docs, ADRs, specs, and more.
- Maintaining clean organization, code style, testing, security, and extended documentation allows a repo to be understood and maintained over time by many contributors.
The document discusses several key points about Python:
1. It summarizes praise for Python from programmers and companies like Google, NASA, and CCP Games, highlighting Python's simplicity, compactness, and ability to quickly develop applications.
2. It introduces common Python concepts like strings, lists, sequences, namespaces, polymorphism, and duck typing. Strings can be manipulated using slicing and methods. Lists and other sequences support indexing, slicing, and iteration.
3. Python uses name-based rather than type-based polymorphism through duck typing - an object's capabilities are defined by its methods and properties rather than its class.
Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...Puppet
This document discusses upgrading Puppet code to work with newer versions of Puppet, specifically Puppet 4. It outlines reasons to upgrade like getting security updates and new features. It provides tips for testing code like using rspec and additional Puppet master processes. Code practices that are deprecated in newer versions are identified like inheritance and modifying remote modules. The presentation demonstrates upgrading a module to Puppet 4.
Puppet Camp Berlin 2014: Manageable puppet infrastructurePuppet
This document discusses setting up a manageable Puppet infrastructure. It outlines common pitfalls like unmaintainable codebases and collaboration difficulties. Quick wins to address pitfalls include moving data to Hiera, implementing code reviews, and refactoring constantly. The document recommends designing around server roles, storing all things data in Hiera, and facilitating deployment and workflow through environments and R10k. It provides examples of setting up roles, using different Hiera data types, and Hiera-related functions to retrieve and generate resources from data.
Why we are migrating to Chef from PuppetYu Yamanaka
This document discusses the author's experience using Puppet and their reasons for switching to Chef. It notes that they started using Puppet in 2012 when it was more popular than Chef. While Puppet worked well initially, they found it inflexible to apply partial manifests or forget dependencies. In contrast, Chef allowed ordering resources intuitively and using Ruby syntax which they were learning to write recipes. The overall message is that Chef enabled them to "Stay Creative" and "Live Comfortably" in their work.
This document discusses Puppet modules and provides examples of how to structure modules to allow for customization and reuse. It outlines 10 design rules for Example42 modules, including separating configuration data from module logic, providing choices for configuration file supply, configuring with defaults but allowing customization, and allowing management of general module behavior. The document provides code examples demonstrating how to implement these rules in Puppet modules.
Twig: Friendly Curly Braces Invade Your Templates!Ryan Weaver
Video: http://youtu.be/Jikkiqt-nBo
Twig! Yep, it's that fancy magic that's supposed to make theming in Drupal 8 as much fun as eating beef brisket at Rudy's Country Store in Austin (apologies to my veggie friends!). And in fact, Twig was *born* for this: a language that was created with one job in mind: making writing templates awesome and powerful. Oh, and to make you love using it.
In this talk, we'll learn about Twig from the ground-up: syntax, filters, inheritance and other tricks you can learn now to be ready for Drupal 8. We'll also look at how Twig looks inside Drupal, and how it compares to what you're used to in Drupal 7.
By the end, you'll know everything to start getting your Drupal 8 theme on and be shouting its praises from the hills! Ok, maybe not that last part (but I do love how excited Drupalers get), but you'll definitely have a new friend in your world: Twig.
The document discusses new features and changes in Puppet 4, including Puppet Server running on JVM, packaging improvements, environment configuration options, language features like lambdas and HEREDOC support, type validation, and deprecations like node inheritance and hyphens in names. It highlights four key powers of Puppet 4: performance, scalability, measurability, and flexibility in dealing with complex data types natively. Upgrading to Puppet 4 requires changes to comply with deprecations and testing to ensure compatibility.
Hear no evil, see no evil, patch no evil: Or, how to monkey-patch safely.Graham Dumpleton
Python is a dynamic programming language and has a strong tradition of adhering to a programming style called duck-typing. This means that it is possible to easily modify an application's code while it is running. One might wish to do this for various reasons, including enhancing the functionality of code, correcting errant behaviour, or adding instrumentation or debugging code.
Making such code modifications can be tricky though and not done correctly can potentially interfere with the operation of the original code, through destroying introspection abilities, not honouring the duck-typing mantra or due to being applied at the wrong time.
If you do need to do monkey patching though, the 'wrapt' library is your friend, with its transparent object proxy wrappers and post import hook mechanism, it allows you to safely monkey patch code to modify its behaviour.
Learn about the 'wrapt' library and the joys, but also the dangers, of monkey patching.
PECL Picks - Extensions to make your life betterZendCon
This document provides information about various PHP extensions available through PECL (PHP Extension Community Library). It introduces the author and their background, describes what PECL is and provides a brief history. It then discusses the current status of PECL, future plans, and how individuals can get involved. Finally, it highlights and provides code examples for several popular and useful PECL extensions, including APC, Memcache, Imagick, HTTP, UploadProgress and others.
This document discusses using Puppet to program IT infrastructures. It introduces Puppet as a tool for automating infrastructure management and provisioning. Puppet uses a declarative language and allows infrastructure to be coded and version controlled. The document provides an overview of Puppet architecture with Master and Agent nodes and explains how nodes are defined and organized using classes and modules. It also shows examples of Puppet code for configuring common services and managing files and templates.
Getting big without getting fat, in perlDean Hamstead
Thoughts on keeping your perl code lean as your code base gets bigger. Ideas on API structure for plugins and modules which can help. Some recommended option settings and module suggestions for handling configuration. A passing reference to logging.
A variety of pop culture, tech and start up culture references to keep things interesting.
All feedback welcome
Presented 18/08/2015 at Sydney PM
Puppi is a Puppet modules that drives Puppet's knowledge of the Systems to a command line tool that you can use to check services availability, gather info on the system and deploy application with a single command.
PHP is a server-side scripting language used to create dynamic web pages. It allows embedding PHP code within HTML pages and interacting with databases. Key elements of PHP include variables, control structures, functions, and sessions. Sessions store user data on the server instead of the client to avoid cookies and allow tracking users across multiple pages.
This document discusses using PHP for both web and desktop applications. It introduces PHP-GTK, which allows PHP to create graphical desktop applications with a native look and feel across platforms. It provides examples of creating windows, containers, working with signals and the main loop. The document also discusses installing PHP-GTK, some key considerations for desktop applications, and examples of creating widgets like trees and working with models.
- The document discusses various patterns and techniques the author has found useful when working with Puppet modules over 10+ years, including some that may be considered unorthodox or anti-patterns by some.
- Key topics covered include optimization of reusable modules, custom data types, Bolt tasks and plans, external facts, Hiera classification, ensuring resources for presence/absence, application abstraction with Tiny Puppet, and class-based noop management.
- The author argues that some established patterns like roles and profiles can evolve to be more flexible, and that running production nodes in noop mode with controls may be preferable to fully enforcing on all nodes.
Puppet camp2021 testing modules and controlrepoPuppet
This document discusses testing Puppet code when using modules versus a control repository. It recommends starting with simple syntax and unit tests using PDK or rspec-puppet for modules, and using OnceOver for testing control repositories, as it is specially designed for this purpose. OnceOver allows defining classes, nodes, and a test matrix to run syntax, unit, and acceptance tests across different configurations. Moving from simple to more complex testing approaches like acceptance tests is suggested. PDK and OnceOver both have limitations for testing across operating systems that may require customizing spec tests. Infrastructure for running acceptance tests in VMs or containers is also discussed.
- A repo should keep code, config, deploy, and documentation matched through versioning and CI/CD tools. Code should be written for others, not just oneself.
- Documentation serves to explain implementation, purpose, context, decisions, and how components work together. Extended documentation includes code comments, docstrings, tests, commits, dev docs, ADRs, specs, and more.
- Maintaining clean organization, code style, testing, security, and extended documentation allows a repo to be understood and maintained over time by many contributors.
The document discusses several key points about Python:
1. It summarizes praise for Python from programmers and companies like Google, NASA, and CCP Games, highlighting Python's simplicity, compactness, and ability to quickly develop applications.
2. It introduces common Python concepts like strings, lists, sequences, namespaces, polymorphism, and duck typing. Strings can be manipulated using slicing and methods. Lists and other sequences support indexing, slicing, and iteration.
3. Python uses name-based rather than type-based polymorphism through duck typing - an object's capabilities are defined by its methods and properties rather than its class.
Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...Puppet
This document discusses upgrading Puppet code to work with newer versions of Puppet, specifically Puppet 4. It outlines reasons to upgrade like getting security updates and new features. It provides tips for testing code like using rspec and additional Puppet master processes. Code practices that are deprecated in newer versions are identified like inheritance and modifying remote modules. The presentation demonstrates upgrading a module to Puppet 4.
Puppet Camp Berlin 2014: Manageable puppet infrastructurePuppet
This document discusses setting up a manageable Puppet infrastructure. It outlines common pitfalls like unmaintainable codebases and collaboration difficulties. Quick wins to address pitfalls include moving data to Hiera, implementing code reviews, and refactoring constantly. The document recommends designing around server roles, storing all things data in Hiera, and facilitating deployment and workflow through environments and R10k. It provides examples of setting up roles, using different Hiera data types, and Hiera-related functions to retrieve and generate resources from data.
Why we are migrating to Chef from PuppetYu Yamanaka
This document discusses the author's experience using Puppet and their reasons for switching to Chef. It notes that they started using Puppet in 2012 when it was more popular than Chef. While Puppet worked well initially, they found it inflexible to apply partial manifests or forget dependencies. In contrast, Chef allowed ordering resources intuitively and using Ruby syntax which they were learning to write recipes. The overall message is that Chef enabled them to "Stay Creative" and "Live Comfortably" in their work.
Puppet Camp Paris 2014: Achieving Continuous Delivery and DevOps with Puppet Puppet
This document discusses achieving continuous delivery with Puppet. It notes that currently, development cycles are long, integration is painful, and deployments are difficult. It proposes that continuous integration, continuous delivery, DevOps practices, and an agile infrastructure using automation can help address these issues. Puppet is presented as a tool that can be used to help achieve an agile infrastructure and automate application deployments, though some challenges with its use are also discussed. The document advocates for changing the relationship between development and operations teams to one of more shared responsibility.
DevOps: What is This Puppet You Speak Of?Rob Reynolds
This document provides an overview of DevOps and Puppet for automating infrastructure management. It discusses how DevOps involves collaboration between development, QA, and operations teams. Puppet is introduced as infrastructure as code tool that allows defining and enforcing a machine's state through code. It works by installing agents on nodes that fetch configuration files (manifests) and enforce the specified configuration. The document highlights Puppet's capabilities for Windows systems and provides examples of common resource types and modules for managing Windows servers through Puppet.
Deliver on DevOps with Puppet Application Orchestration Webinar 11/19/15Puppet
DevOps seeks to align business goals with the goals of development and operations teams. Technology is quickly becoming a strategic business differentiator, bringing IT closer to the business, as customers take advantage of the new applications and services coming online. One challenge IT teams face is a timely way to deploy, configure and manage these critical business applications. A DevOps approach offers enterprises a way to accelerate application delivery.
Join Jeremy Adams, Chris Barker, and Michael Olson from the Puppet Labs team, as they discuss how Puppet Labs’ new Application Orchestration solution helps IT teams deliver on DevOps. You’ll also learn how you can:
-Easily model your application infrastructure to make installations, upgrades and ongoing management repeatable and reliable.
-Configure, deploy and update critical applications faster and without downtime.
-Quickly cycle in new technology, while maintaining and/or cycling out old technology.
Puppet and Chef are both popular configuration management tools, but they differ in their approach - Puppet uses a model-driven approach that is easier for sysadmins to learn, while Chef uses a procedural approach in Ruby that provides more power and flexibility but a steeper learning curve. Both tools are cross-platform but Puppet supports more operating systems officially. While Puppet has a larger user community currently, Chef is growing rapidly as well. Their documentation has both improved significantly over time. Pricing models include free open source versions as well as paid versions for Puppet Enterprise and Chef.
This document discusses GitFlow, SourceTree, and GitLab for software development workflows. It provides an overview of main and supporting branch types in GitFlow like develop, master, feature, release and hotfix. It also summarizes the key features and uses of SourceTree for visualizing Git repositories and GitLab for hosting Git repositories and providing features like activity streams, code review, issues and more.
I have evidence that using git and GitHub for documentation and community doc techniques can give us 300 doc changes in a month. I’ve bet my career on these methods and I want to share with you.
Todd Paulk is an IT professional with over 14 years of experience developing software on Linux operating systems. He has expertise in software engineering, IT management, and project management. His technical skills include programming languages like C, C++, Python, and Perl. He has worked as a software engineer and developed automated processes. He also has experience in system administration, troubleshooting, and implementing DevOps tools like Ansible and Docker. His work history includes positions at Survox, Research Data Design, and The Gallup Organization where he developed custom applications, automated reporting, and analyzed market research data. He has a Bachelor's degree in Journalism from the University of Nebraska.
The document discusses best practices for using Git including basic commands, branches, tags, and collaboration using GitHub. It covers Git fundamentals like committing, pushing, pulling and branching as well as more advanced topics such as rebasing, cherry-picking, stashing and using Git hooks for continuous integration. The presentation aims to help users learn to use Git more efficiently.
An introductory talk to Foreman, with an overview of how Foreman's plugin ecosystem can help you manage your data center. We'll talk about Discovery, Katello, Docker, and additional configuration management platforms beyond Puppet.
Introduction to Git/Github - A beginner's guideRohit Arora
Introduction to Git/Github - A beginner's guide
Agenda:
Installing Git
Introduction to Version Control
Git Basics
Creating a new local Git repository
Cloning a Git repository
Making use of Git commit history
Reverting files to previous states
Creating a Github Repository
Adding, Committing & Pushing changes
Branching
Merging Branches
Sending Pull Requests
Conflict Resolution
and 3 Exercises
Puppet Enterprise is an automation platform that allows organizations to define their infrastructure in code and automatically enforce that configuration. It was demonstrated how Puppet defines infrastructure using a common language and automates configuration across any environment. Benefits shown include significant increases in deployment speed, reductions in outages and security fix time, and more frequent deployments. Next steps suggested trying out Puppet Enterprise or learning resources to see how it can help deliver better software faster through infrastructure automation.
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...Sonatype
There are numerous examples of DevOps and Continuous Delivery reference architectures available, and each of them vary in levels of detail, tools highlighted, and processes followed. Yet, there is a constant theme among the tool sets: Jenkins, Maven, Sonatype Nexus, Subversion, Git, Docker, Puppet/Chef, Rundeck, ServiceNow, and Sonar seem to show up time and again.
Ruby provides several looping structures like for, while, and until loops. Blocks are nameless code segments that can be passed to methods. Procs allow blocks to be treated like objects that are bound to local variables. Lambdas are similar to procs but differ in how they handle parameters and return values. Modules and classes both allow extending behavior but modules cannot be instantiated while classes can.
The document provides an overview of key concepts in object-oriented programming (OOP) including classes, objects, messages, methods, encapsulation, hierarchy, inheritance, overriding, and polymorphism. It explains that OOP groups data and related operations together into classes, and that classes define types of objects that can receive messages and run corresponding methods.
The document provides an introduction to the Bund programming language. Some key features of Bund include:
- It is a simple, stack-based functional language tightly integrated with Python
- Functions are first-class citizens
- Namespaces provide scoping instead of modules
- Support for delayed execution, reverse and direct stack coding, partial application, code as data, and dynamic code generation
- The author created Bund to experiment with PEG parsers and teach himself new tricks as an experienced programmer
Perl is a programming language that was originally released in 1987. It has become widely used for tasks like CGI scripting, databases, and XML processing. Perl is known as a "glue language" because it can interact with many popular applications.
The Comprehensive Perl Archive Network (CPAN) provides a comprehensive library of Perl extension modules, similar to frameworks like J2EE and .NET. CPAN has helped Perl integrate with other languages like C, C++, and Java.
Perl's strength comes from its active user community which maintains resources like CPAN, documentation sites, and local user groups. Perl powers many popular websites and is often called the "duct tape of the Internet" due to its
Scala - The Simple Parts, SFScala presentationMartin Odersky
These are the slides of the talk I gave on May 22, 2014 to the San Francisco Scala user group. Similar talks were given before at GOTO Chicago, keynote, at Gilt Groupe and Hunter College in New York, at JAX Mainz and at FlatMap Oslo.
The document provides definitions and explanations of various object-oriented programming concepts in Delphi such as classes, objects, visibility of class members, inheritance, abstract classes, interfaces, constructors, virtual functions, polymorphism, late binding, encapsulation, properties, exceptions handling, and runtime type information (RTTI). It discusses these concepts through questions and answers. Key points covered include the relationship between classes and objects, differences between visibility levels of class members, how inheritance allows the creation of subclasses, rules around abstract classes and methods, limitations of interfaces, how to define and overload constructors and functions, use of virtual functions and polymorphism, and how RTTI is used.
This ppt describes basics of scala upto collections covering both object oriented and functional programming concepts of the language.
References:Scala cookbook
The document summarizes an advanced Perl training course covering new features in Perl 5.10 like defined-or operator, switch statement, smart matching and say(), as well as testing with modules like Test::MockObject, profiling with Devel::Cover, and benchmarking code with Benchmark.pm. The one-day course will quickly cover many Perl topics and point to additional online resources for further learning.
The document discusses different ways to declare variables in JavaScript. There are three main keywords: var, let, and const. Var declares variables with function scope, let declares block-scoped variables, and const declares block-scoped variables that cannot be reassigned.
Closures allow blocks of code to access variables from the enclosing scope even after the scope has closed. This allows closures to maintain state even when passed around or returned from functions. Closures originated in Lisp and are supported in many modern languages like Python, Ruby, and C#, providing benefits like elegant iteration, filtering, and caching of results. While objects can also be used to inject strategy or share state, closures provide a more concise syntax and avoid wrapper classes in many cases.
Mike Toppa gave a presentation on dependency injection in PHP. He discussed classes and objects in PHP, the SOLID principles including the single responsibility principle and dependency inversion principle. He explained class autoloading in PHP and different techniques for dependency injection including constructor injection, setter injection, and using a dependency injection container.
This document provides an overview of developing a principled approach to input/output (I/O) in Scala using the cats-effect library. It discusses the development of an initial I/O typeclass and improvements to allow composition of I/O actions. It then covers the implementation of an I/O monad to allow I/O actions to return meaningful values. Finally, it demonstrates how cats-effect supports concurrency through abstractions like MVars and provides an example of implementing a channel using an MVar.
This document discusses object-oriented programming (OOP) in PHP. It defines key OOP concepts like classes, objects, methods, and inheritance. It provides examples of creating classes and objects in PHP, and using concepts like constructors, multiple class instances, visibility, and building objects from scratch. The document aims to explain OOP and related terminology to help programmers transition to an object-oriented approach in PHP.
This document provides an overview of key concepts in Ruby including variables, methods, classes, modules, inheritance and scope. It discusses local variables, instance variables, class variables and global variables. It explains how methods are defined and called in Ruby. It describes classes and modules, and how modules can be mixed into classes. The document also covers inheritance, constants, self, and singleton methods. It provides details on variable scope and how Ruby determines an identifier is a variable, keyword or method call.
The document discusses JavaScript, describing it as a language of contrasts with both good and bad parts. It outlines some of the criticisms of JavaScript but argues there is an elegant language hidden underneath. It examines JavaScript's influences and features, identifying good parts like lambda functions, dynamic objects, and loose typing, as well as bad parts like global variables and confusing equality operators. The document also discusses prototypal inheritance, modules, closures, and style in JavaScript. It advocates following standards like JSLint to write more reliable code and avoiding future bad designs by using a safer JavaScript subset.
This document summarizes a presentation on using the Kubernetes API effectively with Golang. The presentation introduces Kubernetes concepts like controllers and indexers. It demonstrates building blocks for Kubernetes applications like clients, stores, indexers, workqueues, and informers. It emphasizes best practices like handling errors, object relations, and accounting for multiple actors. The presentation provides code examples and links to documentation and sample controllers.
The document discusses serverless computing on Kubernetes using the Fission platform. It provides an overview of Fission concepts and architecture, including that Fission allows running serverless functions on Kubernetes, hides underlying complexity from developers, and optimizes resource usage. It also describes Fission features like event queues, function environments, composing functions into workflows, and monitoring. A demo of Fission is mentioned.
This document provides an overview and agenda for a talk on advanced SaltStack concepts. It discusses topics like peer communication between minions, using events and reactors to orchestrate workflows, the Salt mine for sharing real-time data between minions, Salt beacons for monitoring events and triggering reactions, multi-master and syndic architectures for scalability, and provisioning systems using Salt Cloud. Examples and exercises are provided to illustrate concepts hands-on. Debugging techniques for states and understanding what events and data are being passed are also covered.
This document provides an overview and agenda for a hands-on Kubernetes 101 workshop hosted by Vishal Biyani from InfraCloud technologies. The 180-minute workshop includes introductions, conceptual overviews of Kubernetes components like pods and deployments, demonstrations of setting up a Kubernetes cluster on Google Cloud and the local machine, and hands-on labs for working with pods, deployments, services, secrets and Helm. The goal is to help attendees gain practical experience with common Kubernetes patterns, architectures, and tools.
The presentation was made at the first Serverless Pune meetup on 4th Feb 2017 https://www.meetup.com/Serverless-Pune
In the first Meetup, we covered most of the basics & a simple demos. Upcoming meetups will dive deeper into technical implementation and various real world use cases
Presentation from the first meetup of Kubernetes Pune - introduction to Kubernetes (https://www.meetup.com/Kubernetes-Pune/events/235689961)
Mulesoft Cloudhub allows users to visually build integration workflows using a drag-and-drop interface in Mulesoft Studio, an Eclipse-based IDE, drawing from a large library of pre-built components without extensive coding experience. These visual workflows can be customized further by editing the underlying XML and deployed either on-premise or to Cloudhub for cloud management and monitoring of integration applications from a centralized console.
Dell Boomi is an integration platform that allows users to build, deploy, and manage integrations from a web browser. It contains various components like connections, profiles, and maps that can be used to transform and move data between different systems. Dell Boomi comes with out-of-the-box connectors to popular systems like Salesforce, NetSuite, and JIRA. Processes are executed by Atom execution agents that can be installed on-premises or run in the cloud. Atoms can be scaled up as needed and processes can be deployed across multiple agents. While Dell Boomi offers a simple way to get started with browser-based management, customization options are more limited compared to some competitors.
Using CI for continuous delivery Part 3Vishal Biyani
This is part 3 of "Using CI for continuous delivery" in which we test drive Bamboo. More details can be found at www.vishalbiyani.com/ci-continuous-delivery
Using CI for continuous delivery Part 2Vishal Biyani
This is part 3 of "Using CI for continuous delivery" in which we test drive TeamCity. More details can be found at www.vishalbiyani.com/ci-continuous-delivery
Using CI for continuous delivery Part 1Vishal Biyani
This is part 3 of "Using CI for continuous delivery" in which we test drive Go. More details can be found at www.vishalbiyani.com/ci-continuous-delivery
Using CI for continuous delivery Part 4Vishal Biyani
This is part 4 of "Using CI for continuous delivery" in which we test drive Jenkins. More details can be found at www.vishalbiyani.com/ci-continuous-delivery
Get & Download Wondershare Filmora Crack Latest [2025]saniaaftab72555
Copy & Past Link 👉👉
https://dr-up-community.info/
Wondershare Filmora is a video editing software and app designed for both beginners and experienced users. It's known for its user-friendly interface, drag-and-drop functionality, and a wide range of tools and features for creating and editing videos. Filmora is available on Windows, macOS, iOS (iPhone/iPad), and Android platforms.
Societal challenges of AI: biases, multilinguism and sustainabilityJordi Cabot
Towards a fairer, inclusive and sustainable AI that works for everybody.
Reviewing the state of the art on these challenges and what we're doing at LIST to test current LLMs and help you select the one that works best for you
AgentExchange is Salesforce’s latest innovation, expanding upon the foundation of AppExchange by offering a centralized marketplace for AI-powered digital labor. Designed for Agentblazers, developers, and Salesforce admins, this platform enables the rapid development and deployment of AI agents across industries.
Email: [email protected]
Phone: +1(630) 349 2411
Website: https://www.fexle.com/blogs/agentexchange-an-ultimate-guide-for-salesforce-consultants-businesses/?utm_source=slideshare&utm_medium=pptNg
Explaining GitHub Actions Failures with Large Language Models Challenges, In...ssuserb14185
GitHub Actions (GA) has become the de facto tool that developers use to automate software workflows, seamlessly building, testing, and deploying code. Yet when GA fails, it disrupts development, causing delays and driving up costs. Diagnosing failures becomes especially challenging because error logs are often long, complex and unstructured. Given these difficulties, this study explores the potential of large language models (LLMs) to generate correct, clear, concise, and actionable contextual descriptions (or summaries) for GA failures, focusing on developers’ perceptions of their feasibility and usefulness. Our results show that over 80% of developers rated LLM explanations positively in terms of correctness for simpler/small logs. Overall, our findings suggest that LLMs can feasibly assist developers in understanding common GA errors, thus, potentially reducing manual analysis. However, we also found that improved reasoning abilities are needed to support more complex CI/CD scenarios. For instance, less experienced developers tend to be more positive on the described context, while seasoned developers prefer concise summaries. Overall, our work offers key insights for researchers enhancing LLM reasoning, particularly in adapting explanations to user expertise.
https://arxiv.org/abs/2501.16495
Interactive Odoo Dashboard for various business needs can provide users with dynamic, visually appealing dashboards tailored to their specific requirements. such a module that could support multiple dashboards for different aspects of a business
✅Visit And Buy Now : https://bit.ly/3VojWza
✅This Interactive Odoo dashboard module allow user to create their own odoo interactive dashboards for various purpose.
App download now :
Odoo 18 : https://bit.ly/3VojWza
Odoo 17 : https://bit.ly/4h9Z47G
Odoo 16 : https://bit.ly/3FJTEA4
Odoo 15 : https://bit.ly/3W7tsEB
Odoo 14 : https://bit.ly/3BqZDHg
Odoo 13 : https://bit.ly/3uNMF2t
Try Our website appointment booking odoo app : https://bit.ly/3SvNvgU
👉Want a Demo ?📧 [email protected]
➡️Contact us for Odoo ERP Set up : 091066 49361
👉Explore more apps: https://bit.ly/3oFIOCF
👉Want to know more : 🌐 https://www.axistechnolabs.com/
#odoo #odoo18 #odoo17 #odoo16 #odoo15 #odooapps #dashboards #dashboardsoftware #odooerp #odooimplementation #odoodashboardapp #bestodoodashboard #dashboardapp #odoodashboard #dashboardmodule #interactivedashboard #bestdashboard #dashboard #odootag #odooservices #odoonewfeatures #newappfeatures #odoodashboardapp #dynamicdashboard #odooapp #odooappstore #TopOdooApps #odooapp #odooexperience #odoodevelopment #businessdashboard #allinonedashboard #odooproducts
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Versionsaimabibi60507
Copy & Past Link👉👉
https://dr-up-community.info/
Pixologic ZBrush, now developed by Maxon, is a premier digital sculpting and painting software renowned for its ability to create highly detailed 3D models. Utilizing a unique "pixol" technology, ZBrush stores depth, lighting, and material information for each point on the screen, allowing artists to sculpt and paint with remarkable precision .
Solidworks Crack 2025 latest new + license codeaneelaramzan63
Copy & Paste On Google >>> https://dr-up-community.info/
The two main methods for installing standalone licenses of SOLIDWORKS are clean installation and parallel installation (the process is different ...
Disable your internet connection to prevent the software from performing online checks during installation
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDinusha Kumarasiri
AI is transforming APIs, enabling smarter automation, enhanced decision-making, and seamless integrations. This presentation explores key design principles for AI-infused APIs on Azure, covering performance optimization, security best practices, scalability strategies, and responsible AI governance. Learn how to leverage Azure API Management, machine learning models, and cloud-native architectures to build robust, efficient, and intelligent API solutions
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMaxim Salnikov
Imagine if apps could think, plan, and team up like humans. Welcome to the world of AI agents and agentic user interfaces (UI)! In this session, we'll explore how AI agents make decisions, collaborate with each other, and create more natural and powerful experiences for users.
Copy & Paste On Google >>> https://dr-up-community.info/
EASEUS Partition Master Final with Crack and Key Download If you are looking for a powerful and easy-to-use disk partitioning software,
Discover why Wi-Fi 7 is set to transform wireless networking and how Router Architects is leading the way with next-gen router designs built for speed, reliability, and innovation.
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Ranjan Baisak
As software complexity grows, traditional static analysis tools struggle to detect vulnerabilities with both precision and context—often triggering high false positive rates and developer fatigue. This article explores how Graph Neural Networks (GNNs), when applied to source code representations like Abstract Syntax Trees (ASTs), Control Flow Graphs (CFGs), and Data Flow Graphs (DFGs), can revolutionize vulnerability detection. We break down how GNNs model code semantics more effectively than flat token sequences, and how techniques like attention mechanisms, hybrid graph construction, and feedback loops significantly reduce false positives. With insights from real-world datasets and recent research, this guide shows how to build more reliable, proactive, and interpretable vulnerability detection systems using GNNs.
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Eric D. Schabell
It's time you stopped letting your telemetry data pressure your budgets and get in the way of solving issues with agility! No more I say! Take back control of your telemetry data as we guide you through the open source project Fluent Bit. Learn how to manage your telemetry data from source to destination using the pipeline phases covering collection, parsing, aggregation, transformation, and forwarding from any source to any destination. Buckle up for a fun ride as you learn by exploring how telemetry pipelines work, how to set up your first pipeline, and exploring several common use cases that Fluent Bit helps solve. All this backed by a self-paced, hands-on workshop that attendees can pursue at home after this session (https://o11y-workshops.gitlab.io/workshop-fluentbit).
How can one start with crypto wallet development.pptxlaravinson24
This presentation is a beginner-friendly guide to developing a crypto wallet from scratch. It covers essential concepts such as wallet types, blockchain integration, key management, and security best practices. Ideal for developers and tech enthusiasts looking to enter the world of Web3 and decentralized finance.
Adobe Lightroom Classic Crack FREE Latest link 2025kashifyounis067
🌍📱👉COPY LINK & PASTE ON GOOGLE http://drfiles.net/ 👈🌍
Adobe Lightroom Classic is a desktop-based software application for editing and managing digital photos. It focuses on providing users with a powerful and comprehensive set of tools for organizing, editing, and processing their images on their computer. Unlike the newer Lightroom, which is cloud-based, Lightroom Classic stores photos locally on your computer and offers a more traditional workflow for professional photographers.
Here's a more detailed breakdown:
Key Features and Functions:
Organization:
Lightroom Classic provides robust tools for organizing your photos, including creating collections, using keywords, flags, and color labels.
Editing:
It offers a wide range of editing tools for making adjustments to color, tone, and more.
Processing:
Lightroom Classic can process RAW files, allowing for significant adjustments and fine-tuning of images.
Desktop-Focused:
The application is designed to be used on a computer, with the original photos stored locally on the hard drive.
Non-Destructive Editing:
Edits are applied to the original photos in a non-destructive way, meaning the original files remain untouched.
Key Differences from Lightroom (Cloud-Based):
Storage Location:
Lightroom Classic stores photos locally on your computer, while Lightroom stores them in the cloud.
Workflow:
Lightroom Classic is designed for a desktop workflow, while Lightroom is designed for a cloud-based workflow.
Connectivity:
Lightroom Classic can be used offline, while Lightroom requires an internet connection to sync and access photos.
Organization:
Lightroom Classic offers more advanced organization features like Collections and Keywords.
Who is it for?
Professional Photographers:
PCMag notes that Lightroom Classic is a popular choice among professional photographers who need the flexibility and control of a desktop-based application.
Users with Large Collections:
Those with extensive photo collections may prefer Lightroom Classic's local storage and robust organization features.
Users who prefer a traditional workflow:
Users who prefer a more traditional desktop workflow, with their original photos stored on their computer, will find Lightroom Classic a good fit.
3. www.vishalbiyani.comLearning Puppet
Puppet
language
Puppet is a DSL based on Ruby – an object oriented programming
language. So do you need to know Ruby in and out to work with
Puppet ? Not necessarily!The whole idea of this chapter is to
introduce enough puppet & ruby to work with it.
Puppet is declarative which has two implications
• You define the final desired state not how to achieve it
• The sequence in which tasks are carried out is not guaranteed unless you
explicitly specify it.
You don’t have to master all of the concepts right here – but do
spend some time understanding syntax in this chapter.You can
3|
spend some time understanding syntax in this chapter.You can
always come back to understand any specific part which might
not be clear.
As with any language – there are sometimes multiple ways to do the
same thing and this is true for Puppet/Ruby too.
Lastly covering an entire language in such short span is a challenge.
So do refer to guides & references:
Some useful links:
• https://docs.chef.io/ruby.html provides ruby
basics needed for Chef framework. A good quick
introduction
• Similar quick guide from Puppet documentation:
http://docs.puppetlabs.com/puppet/3.7/reference
/lang_visual_index.html
• For the super curious once for quickly learning
Ruby there is no better source than
https://rubymonk.com/ that I know of!
Some language features are best explained within a
context – with a use case or a problem. Hence those
parts of puppet language have been intentionally
skipped here and will be covered as we go.
4. www.vishalbiyani.comLearning Puppet
Variables &
Expressions
Lot of times we also need to resolve variables within a string for ex:
Variables can be declared with names starting
with $ and value can be a literal value or a
function/expression which resolves to a value.
1 $name = "vishal"
2 $number = 10+2
As long as the value that a variable resolves to is
compatible with data type of intended target, it
can be used as part of expression, function or
attribute!You will also see variables in following
6 $f_name = "${conf_dir}/.conf"
3 $users = ['us1','us2']
4 $users += ['us3']
Here we are resolving variable named conf_dir within a string – called
interpolation. Similarly addition of variables of same type is easy:
Now coming to one of most important features of variables – you can
assign a variable only once in a given scope. In a new scope you can assign a
new value to same variable, for example below the $name is reassigned but
in a new scaope – scope of the class testClass:
1 $name = "Default Name"
2 class testClass {
3 $name = "Test Class Name"
4 }
4|
attribute!You will also see variables in following
form:
4 $tomcat::config::tc_port
What does this mean? It means a variable called
“tc_port” from class tomcat::config. We will see
the classes & modules shortly.You can access
variables from parent scopes but not from child
scope (And we will scope in detail soon). For
example you can access a top level variable from
class level scope but not other way around. Also
there is a special notation for variables at top
scope – the scope is blank. In following example
we are getting “osfamily” from top scope
4 $::osfamily
4 }
Lastly – a variable can not be resolved unless it is defined.Which means
unlike rest of Puppet – order matters while defining variables.
Expressions
Most expressions in puppet are usual suspects of any programming
language like == (Equality), != (Non Equality), ,< , > , <= , >= , and, or, ! , +, -,
/, *, % etc. Couple of them that need some attention are not found in some
languages are:
=~ Left hand is a string & right hand is a regex – if match is found
then returns true
!~ Left hand is a string and right is a regex – if match is found
returns false
in Left hand operand should be string and right hand could be
string, array, hash. It checks if string on left side is “in” the right
side variable. Returns true if found
5. www.vishalbiyani.comLearning Puppet
Of Conditions
We have quite a few friends in conditional
statements in Puppet – if, unless, case &
selectors.This part is quite easy so let’s run over it
quick!
Our if, elseif & else block is dead simple
1 if $osfamily == 'linux'{
2 # Do something
3 }
4 elseif $osfamily == 'windows'{
5 # Do something else
6 }
7 else
8 # Do something horrible here
But if we use regular expression in if block – there
Unless is exact opposite of if – but without additional else & regex magic:
1 unless $osfamily == 'linux'{
2 # Only for Linux family things
3 }
1 case $osfamily {
2 'Linux' : {include role::linux}
3 'Windows': {include role::windows}
4 default : {include role::default}
5 }
Case statement is also similar to other languages, almost like having
multiple if conditions & a default condition which will be executed if none of
previous conditions meet. And oh they also support regex capture variables if
you are using a regular expression to evaluate the case expression!
Finally the selectors!They are a special case of case conditional expression
and differ in behavior. In case statement we execute a piece of code once the
5|
But if we use regular expression in if block – there
is some black magic happening. If you look at
regular expression below – it is expecting string
some and varying digits after it – like some01,
some02 etc. Now these might be your hostnames
and would be good to get them inside the
execution block – as shown in comments within
the block.They have a name: “Regex Capture
variables”
10 if $hostname =~ /^some(d+)./ {
11 # Magic happens here with $0 and $1
12 # If some2 is passed then $1 has value
of 2
13 # and $0 has value of some2 - entire
match
14 }
and differ in behavior. In case statement we execute a piece of code once the
condition in a block is met, but in case of selector statement when the
expression evaluates to true – a value is returned.This value can be assigned
to a variable and then used later in flow. Imagine a situation where your
windows user name and linux username for certain operation is different –
and you want to use a selector to determine the user name dynamically
based on OS as shown in example below:
1 $user_name = $osfamily ? {
2 'windows' => 'win_admin',
3 'linux' => 'root_user',
4 default => 'root',
5 }
In above code – if $osfamily is windows then the username is different and if
it is linux then it is a different user.
6. www.vishalbiyani.comLearning Puppet
Functions & Classes
Functions when it comes to puppet have a special
meaning.They are already defined pieces of code
which you can use to get things done. But more
importantly – functions are evaluated at
compilation time.Which means when your
manifest convert to catalog – the functions either
return their values or modify catalog based on
function!We have already used a function on
previous slide – which includes roles:
A class is a logical grouping of resources which can be accessed by class
name.There are two parts to it- first is you define the class and secondly you
call (Called declare) it.The execution happens only when you make a call.
Let’s first see how to define classes:
2 'Linux' : {include role::linux}
Another function which returns a value of true or
false based on input:
1 class test {
2 # Resource declarations here
3 }
4 class testParam ($name = 'default_value') {
5 # You can use the $name in any resource declaration
6 }
In first example above we defined a class which does not take any
parameters.Second one takes a parameter called “name” and if the caller
does not provide any value then “default_value” is chosen.This is just to
safeguard in case no value is provided & is a good practice to have a default.
The resources inside class are defined as you would do normally and they
6|
false based on input:
1 str2bool($is_virtual)
Functions have following characteristics:
• Rvalues type of function retuen some value (Like
str2bool)
•Statements kind of function will do some work but
wont return anything (Like include)
•Functions can take arguments – based on their
definition of what kind of & how many arguments
they take.
•Functions are run at compilation time and hence
on master – so any agent specific data/code should
be done using functions. Instead use
resource/custom facts (Which we will see soon)!
The resources inside class are defined as you would do normally and they
are belong/related to class.
The classes should be in files with name of class & ideally should be in
manifests directory within a module.You can of course place classes within
main manifest or manifests which are imported into main manifest, but for
now we won’t look at those cases.
Puppet also has concept of class inheritance but it should be used sparingly.
We will see the concept and when to use it in later chapters including how to
override parent resource attributes
7. www.vishalbiyani.comLearning Puppet
Declaring Classes
Before we deep dive into declaring/calling classes
let’s understand a fundamental difference due
the way this evolved with Puppet:
•Include-like way:This was introduced in 3.x &
later versions.You can declare a class any number
of times but it will be called only once. It uses a
combination of external data & defaults to set
values of parameters. (Good practice of
externalizing configuration data from code). It is
suggested to use this way.
•Resource-like way:This is old way – in which
Let’s say you want to include a class into another one, this can be done
using “require” funcion which BTW is different than require used for
ordering.The require’s behavior is include like and you can pass list
separated by comma, array etc.
There is third include like way of declaring classes which uses hiera but we
will see that when we talk about hiera!
Now let’s look at resource like way of declaring classes which is not
suggested after version puppet 3. It is as good as declaring any other
resource:
6 define nix::tomcat(){
7 require java
8 }
10 class {‘nix::tomcat’}
7|
•Resource-like way:This is old way – in which
you declare a class the way you declare a
resource.You MUST DECLARE ONLY ONCE!You
can override parameters else they will be taken
from external data or lastly form defaults!
Now let’s see in how many different ways we can
declare classes.
Include: this is of course include like way to
declare classes and can take many forms
There is another way to assign classes to some nodes is via something called
ENC - External Node Classifier!Why would you do that?
External node classification is process of defining which node belong to
which classes. Doing it separate from automation tool provides loose
coupling & separation of concerns. ENC can be an external script or a
system which when called gives data of which nodes need to be applied
which classes and the automation tool accordingly applies the same. For
example many organizations store the node data in LDAP and in such case
you will fetch data from LDAP and then run puppet based on which nodes
needs which class.This is a topic which needs more detailed treatment and
we will not go into much details on this one at the moment.
1 include nix::tomcat
2 include nix::tomcat, nginx
3 clas_list = ['nix::tomcat','nginx']
4 include clas_list
10 class {‘nix::tomcat’}
8. www.vishalbiyani.comLearning Puppet
Resource & types
Some more ground rules for resources:
•You can not declare the same resource twice! Imagine if in one place you
said file should be present and other place absent. Since puppet is declarative
language – it has to have a clear state defined. Although you can add
attributes to already defined resource for example:
1 file { "/home/vagrant/testFile"
2 ensure => present,
3 owner => 'root',
4 group => 'root',
5 mode => '0400',
6 }
Lifecycle of a resource:
When a resource declaration is executed, following things happen:
• The resource’s current state is read.
• If there is a different in current state vs. desired state then the change the
resource to desired state.
• The change in state is logged as event. This event will appear in log files
& reports.
The title of type in this case is
Every resource has a type – in our example below
it is file. It can be a service you want to manage or
a package that needs installed etc.
8|
attributes to already defined resource for example:
1 file { '/home/vagrant/testFile'
2 ensure => present,
3 }
4 File['/home/vagrant/testFile']{
5 owner => 'root',
6 group => 'root',
7 mode => '0400',
8 }
The title of type in this case is
‘/home/vagrant/testFile’ & rest of the details are
”attributes” with values (Equivalent to
parameters in context of resources). Now the
“ensure” attribute will ensure that the file is
“present” – meaning it exists.The value of ensure
might vary from type to type – for example for a
service you might say “running” . So we are
defining the desired state of the a resource. How
to achieve it is what puppet does it for us on
multiple platforms. So in short a resource has
primarily three things – type, title & one or more
attributes. Attributes also might vary form type
to type.
•The order in which you declare resources in file does not matter. Meaning
during execution the order might change for execution optimization. So if you
want to introduce sequence in resource execution – you will have to use
relationships, which we will see shortly.
9. www.vishalbiyani.comLearning Puppet
Objects & Scope 1/2 Now in real world scenarios when you configure nodes/machine – one
node might be Database server while another might be a Application
Server and so on. So you need to define what is a node’s identity! (Also
called node classification). In Puppet we can define a node’s identity in a
file /etc/puppet/manifests/site.pp – and this is our next level of structure.
Let’s say you have a Database node – you might want to configure OS
level resources first – which will be common across all type of nodes. After
that you might apply database specific resource definitions.These two
should be ideally in separate modules. So our node definition looks like:
Remember that everything in Puppet is
resource? But as we add more resources – there
is a need of a structure to manage them. It’s
almost like game of lego – you first get smaller
blocks and combine them to make bigger
structures.
We can combine related resources together to
create a class. And we can combine smaller
classes to create bigger classes. For example we
50 #/etc/puppet/manifests/site.pp
51 node 'database.mycompany.com' {
52 include os_common
53 include database
9|
classes to create bigger classes. For example we
might have a class for managing a file:
42 class base::home {
43 file { '/home/vagrant':
44 owner => 'root',
45 group => 'root',
46 mode => '0644',
47 }
48 }
Next we combine classes & configuration data to
create modules.These modules & classes can be
called from outside. Again we won’t go to depths
of module right away but consider that as next
logical level of structure.
53 include database
54 }
Here the modules os_common & and database is applied on a node
named “database.mycompany.com”
And now we have last structural element – “top”! It will be more clear
when we talk about scope in next slide but for now it is a level which
applies to all nodes in your infrastructure.
10. www.vishalbiyani.comLearning Puppet
Objects & Scope 2/2
What is scope? A way to isolate & limit reach of things. In case of puppet
specifically scope applies to variables & resource defaults. Let’s checkout various
scope levels and their interplay:
TopScope: is what you define at top most level and is accessible everywhere!
Node Scope:Things that you define in your node definition exist at node scope.
Code you define at node scope is available to classes included in that node but
not at top scope.
Local scope is something local to a class, resource declaration or a method etc.
Overriding is the means to override a variable's value form parent scope. Let’s
say we define “message” at node scope and need to override in a class:
We saw four levels in last slide: Resource, Class,
Node & top. Module is just a structural element
which encompasses classes and is not a scope level
really.Scopes form a hierarchy – for example you
can access top scope code at node scope but not
other way around. Basically a parent scope
code/variable can be accessed at child level but child
level can not access things at parent level. Below
picture illustrates the scopes at various levels.
topTop Scope
1 node example.com {
2 $message = "This is node"
3 include
4 }
10|
resource
resource
resource
resource
resource
classclass
module
class filesconfig
Node definition
Local
Scopes
Node Scope
4 }
5 class test_class {
6 $message = "This is class overriding node"
7 notify{"Test message = $message":}
8 }
What will get printed above? Message from class due to overriding.
The scopes of top & class get names – i.e. they can be references using a
notation like $::variable etc. But node & local scopes don’t get names hence
they can not be referenced. Finally the variables which are not in your scope and
have name (i.e. do not belong to node/local) can be accessed with their full
names. For example let’s say the class tomcat has a parameter named port, we
can call it with it’s fully qualified name:
1 include tomcat::config
2 $port = $tomcat::config::port_num
11. www.vishalbiyani.comLearning Puppet
Relations & Ordering
We saw that the sequence of execution of resources
can be different than what we see in manifest. But
there are times when you need to enforce order –
and that’s where ordering attributes help us.There
are four attributes – or metaparameters which
enable ordering:
Attribute Effect
before Execute current resource before and
Let’s say we want to ensure package “ssh” is installed first and then the file
“/etc/ssh/ssh_config” is configured. So there are two ways to do it (With only
relevant attributes:
10 file {'/etc/ssh/ssh_config'
11 ensure => present,
12 require => Package[ssh]
13 }
14 package {'ssh'
15 ensure => installed,
16 }
18 file {'/etc/ssh/ssh_config'
19 ensure => present,
20 }
21 package {'ssh'
22 ensure => installed,
23 before => File['/etc/ssh/ssh_config']
24 }
Similarly let’s say we want the service SSH to be running only after the file
“/etc/ssh/ssh_config” is configured. In addition the service SSH should be
11|
The notation -> (ordering) and ~> (Ordering + Refresh) are equivalent to the four attributes above based on direction you use
them. You can use them or be more explicit and use the attribute names. These arrows are lovingly called “chaining arrows”
before Execute current resource before and
target resource later
require Execute current resource later and
target resource before
notify Execute current resource before,
target resource later & refresh target
resource of current one changes
subscribe Execute target resource before, then
execute current resource, and refresh
current if target has changed
As you have noticed – before and require are same
things but depends on where you declare it. Ditto
with notify & subscribe but with a refresh included.
Quite confusing? – let’s look at some example.
“/etc/ssh/ssh_config” is configured. In addition the service SSH should be
restarted every time the file changes. Again two ways we can configure it:
26 file {'/etc/ssh/ssh_config'
27 ensure => present,
28 notify => Service['ssh'],
29 }
30 service {'ssh'
31 ensure => running,
32 }
34 file {'/etc/ssh/ssh_config'
35 ensure => present,
36 }
37 service {'ssh'
38 ensure => running,
39 subscribe => File['/etc/ssh/ssh_config']
40 }
• You can refer an array of resources in value for attributes. For example you can
restart SSH and some other service as file changes.
• There are more complex scenarios where you might want to use “resource
collectors” – but more on that later ☺
12. www.vishalbiyani.comLearning Puppet
What did we learn?
Although we covered quite a few
things, we have omitted many
details and certain concepts
altogether in this chapter.This is
intentional and we will pick up
those concepts with examples so
that they make lot more sense
than bunch of theory concepts.
Let’s start building stuff now!
This chapter seems like lot of
theory but as stated in
introduction – do a sanity round
and come back to this chapter
every time you come across a
certain concept and need help
implementing it.We have
covered quite a few things and
we will start using them in
12|
Let’s start building stuff now!we will start using them in
upcoming chapters.