实例介绍
Ansible-For-DevOps这本书的pdf文档,不过是英文版的,有一定英语水平的朋友可以下载学习。
Tweet this book! Please help Jeff Geerling by spreading the word about this book on twitter! The suggested tweet for this book is I just purchased @Ansible Dev Ops by @geerlingguy on @leanpub https://leanpub.com/ansible-for-devops#ansible The suggested hashtag for this book is #ansible Find out what other people are saying about the book by clicking on this link to search for this hashtag on Twitter https://twitter.com/search?q=#ansible This book is dedicated to my wife, Natalie, and my children Editing by Margie Newman and Katherine geerling Cover photograph and illustration o 2011 Jeff Geerling Ansible is a software product distributed under the GNU GPLv3 open source license Contents Foreword Preface Who is this book for? Typographic conventions Please help improve this book about the author Introduction In the beginning there were sysadmins .,V1l Modern infrastructure management Ansible and ansible. inc VI Ansible examples iixx Other resources Chapter 1-Getting Started with Ansible Ansible and Infrastructure Management On snowflakes and shell scripts Configuration management Installing Ansible Creating a basic inventory file Running your first Ad-Hoc Ansible command Summary .... 236789 Chapter 2-Local Infrastructure Development: Ansible and Vagrant Prototyping and testing with local virtual machines Your first local server: Setting up Vagrant 10 CONTENTS Using Ansible with Vagrant Your first Ansible playbook 13 Cleaning Up 16 Summary 16 Chapter 3-Ad-Hoc Commands 17 Conducting an orchestra Build infrastructure with Vagrant for testing 78 Inventory file for multiple servers 20 Your first ad-hoc commands 22 Discover Ansibles parallel nature 22 Learning about your environment 24 Make changes using ansible modules 27 Configure groups of servers, or individual servers 28 Configure the Application servers 29 Configure the Database servers 30 Make changes to just one server 31 Manage users and groups 32 Manage packages 33 Manage files and directories 34 Get information about a file 34 Copy a file to the servers 34 Retrieve a file from the servers 35 Create directories and files 35 Delete directories and files 35 Run operations in the background 36 Update servers asynchronously, monitoring progress 36 Fire-and-forget tasks 38 Check log file g es 39 Manage cron jobs ............ 40 Deploy a version-controlled application..................41 Ansibles SSH connection history 42 Paramiko 43 OpenSsH(default) 43 Accelerated mode 43 Faster OpenSSh in Ansible 1.5+ 44 CONTENTS Summary Chapter 4- Ansible playbooks 47 Power plays Running Playbooks with ansible-playbook 47 52 Limiting playbooks to particular hosts and groups........... 52 Setting user and sudo options with ansible-playbook......... 53 Other options for ansible-playbook 54 Real-world playbook: CentOS Node. js app server .............55 Add extra repositories 56 Deploy a Node js app 59 Launch a node. js app Node. js app server summary 62 Real-world playbook: Ubuntu LAMP server with Drupal Include a variables file and discover pre tasks and handlers 63 Basic LAMP server setup 65 Configure apache 67 Configure phP with lineinfile 69 Configure MySQL 70 Install Composer and drush 72 Install Drupal with Git and Drush 74 Drupal LAMP server summary 76 Real-world playbook: Ubuntu server with Solr 77 Include a variables file, and more pre tasks and handlers 77 Install Java 8 79 Install Apache Solr 79 Apache Solr server summary 81 Summary 82 Foreword Over the last few years, Ansible has rapidly become one of the most popular It automation tools in the world. We've seen the open source community expand from the beginning of the project in early 2012 to over 1200 individual contributors today. Ansible's modular architecture and broad applicability to a variety of automation and orchestration problems created a perfect storm for hundreds of thousands of users worldwide Ansible is a general purpose IT automation platform, and it can be used for a variety of purposes. From configuration management: enforcing declared state across your infrastructure, to procedural application deployment, to broad multi-component and multi-system orchestration of complicated interconnected systems. It is agentless,so it can coexist with legacy tools, and it's easy to install, configure, and maintain Ansible had its beginnings in 2012, when Michael DeHaan, the projects founder took inspiration from several tools he had written prior, along with some hands-on experience with the state of configuration management at the time, and launched the project in February of 2012. Some of Ansible's unique attributes like its module-based architecture and agentless approach quickly attracted attention in the open source world In 2013. Said Ziouani. Michael dehaan and i launched ansible. inc. We wanted to harness the growing adoption of Ansible in the open source world, and create products to fill the gaps in the it automation space as we saw them. The existing tools were complicated, error-prone, and hard to learn. Ansible gave users across an it organization a low barrier of entry into automation, and it could be deployed incrementally, solving as few or as many problems as the team needed without a big shift in methodology This book is about using Ansible in a DevOps environment. Im not going to try to define what DevOps is or isnt, or who's doing it or not. My personal interpretation of the idea is that devOps is meant to shorten the distance between the developers writing the code, and the operators running the application. Now, i dont believe Foreword adding a new devOps team in between existing development and operations teams achieves that objective!(Oops, now I'm trying for a definition, arent I?) Well, definitions aside, one of the first steps towards a DevOps environment is choosing tools that can be consumed by both developers and operations engineers Ansible is one of those tools: you dont have to be a software developer to use it, and the playbooks that you write can easily be self-documenting. There have been a lot of attempts at write once, run anywhere models of application development and deployment, but I think ansible comes the closest to providing a common language that's useful across teams and across clouds and different datacenters The author of this book, Jeff, has been a long-time supporter, contributor, and advocate of Ansible, and hes maintained a massive collection of impressive Ansible roles in Galaxy, the public role-sharing service maintained by Ansible, Inc. Jeff has used Ansible extensively in his professional career, and is eminently qualified to write to the end-to-end book on ansible in a devops environment As you read this book, i hope you enjoy your journey into IT automation as much as we have. Be well, do good work, and automate everything Tim gerla Ansible. Inc. Co-Founder cto Preface Growing up, I had access to a world that not many kids ever get to enter. At the local radio stations where my dad was chief engineer, I was fortunate to get to see networks and IT infrastructure up close: Novell servers and old Mac and Windows workstations in the 90s; Microsoft and Linux-based servers; and everything in between. Best of all, he brought home decommissioned servers and copies of linux burned to CD I began working with Linux and small-scale infrastructures before I started high school, and my passion for infrastructure grew as I built a Cat5 wired network and a small rack of networking equipment for a local grade school. when i started developing full-time, what was once a hobby became a necessary part of my job, so I invested more time in managing infrastructure efficiently. Over the past ten years Ive gone from manually booting and configuring physical and virtual servers; to using relatively complex shell scripts to provision and configure servers; to using configuration management tools to manage many cloud-based servers When i began converting my infrastructure to code, some of the best tools for testing, provisioning, and managing my servers were still in their infancy, but they have since matured into fully-featured, robust tools that i use every day. Vagrant is an excellent tool for managing local virtual machines to mimic real-world infrastructure locally (or in the cloud), and Ansible the subject of this book is an excellent tool for provisioning servers, managing their configuration, and deploying applications, even on my local workstation These tools are still improving rapidly, and I'm excited for what the future holds The time I invest in learning new infrastructure tools well will be helpful for years to come(Ansible, Docker, and Vagrant seem a potent combination for both local and production infrastructure, but that's a little outside of this books scope. In these pages, Ill share with you all Ive learned about Ansible: my favorite tool for server provisioning, configuration management, and application deployment. I hope you enjoy reading this book as much as i did writing it Jeff Geerling, 2015 【实例截图】
【核心代码】
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论