PageRenderTime 61ms CodeModel.GetById 31ms RepoModel.GetById 0ms app.codeStats 0ms

/slides.md

https://gitlab.com/cfedde/aghi_ansible
Markdown | 357 lines | 266 code | 91 blank | 0 comment | 0 complexity | 1c67637000d810344c91ca6eca13e8f7 MD5 | raw file
  1. # Who Am I?
  2. * Chris Fedde
  3. * chris@fedde.us
  4. * System programmer
  5. * System administrator
  6. # Who Am I?
  7. * Chris Fedde
  8. * DevOps
  9. * Developer
  10. * In an Operations team
  11. # Ground Rules
  12. * Open forum
  13. * Ask, Interrupt, Comment, Kibitz
  14. # Ground Rules
  15. * Tell me when I'm making a mistake
  16. * You'll get extra credit!
  17. # Ground Rules
  18. * Breaks every hour ( set timer )
  19. * Afters
  20. * El Noa Noa
  21. # About You
  22. * Who are you
  23. * What brings you here
  24. # Assumptions
  25. * You have a reasonable grasp of the linux/unix command line
  26. * what is a pipe?
  27. * how to navigate directories
  28. * how to run command lines
  29. # Assumptions
  30. * You have an ssh client
  31. * with you today
  32. * that can access the local network
  33. # Assumptions
  34. * Pair Admin
  35. * Like Pair Programming
  36. * Solves the cross training problem
  37. # Assumptions
  38. * [DDG](https://duckduckgo.com/)
  39. * [Ansible Documentation](http://docs.ansible.com/)
  40. # Availability
  41. * This courseware is freely available
  42. * [https://gitlab.com/cfedde/aghi_ansible](https://gitlab.com/cfedde/aghi_ansible)
  43. # License
  44. * Many components I`ve used have their own copyright and license
  45. * All software used is free (lebre/gratis)
  46. * This courseware is placed in the public domain.
  47. # Any questions before we get into it?
  48. # Manage a complex of servers
  49. * Maybe a large number of servers
  50. * With minimal personnel
  51. # Words
  52. * Grouping words for a bunch of servers
  53. * What to call a bunch of servers?
  54. # Words
  55. What to call a bunch of servers?
  56. * Cluster
  57. * Farm
  58. * Pile
  59. * Complex
  60. # Words
  61. * "Server Complex"
  62. * I like this term better
  63. * "Administrative Domain"
  64. # "Server Complex"
  65. ## "Administrative Domain"
  66. * kinda like a broadcast domain
  67. * from networking?
  68. * does that help?
  69. * No?
  70. # "Server Complex"
  71. ## "Administrative Domain"
  72. * Some number of manageable elements
  73. * Supported by a common team of admins
  74. * Shared access policies
  75. * The machines where you change root password when someone leaves
  76. # Managing the server complex
  77. * How did we get here
  78. * Brand new fresh deployment
  79. * Old stinky boxes with almost no conventions
  80. * Applances
  81. * Faberge Eggs
  82. # Thought Experiment
  83. * The Heaping Pile of Servers
  84. * Engineers
  85. * No one has done any admin
  86. * Everyone has root
  87. * Engineering in Place (EIP)
  88. * Discovery
  89. # Solving the Problem
  90. * Discipline
  91. * Tools
  92. * Automation
  93. * Conventions
  94. * Contain Complexity
  95. * Build on good solutions
  96. * Build on good practice
  97. # Solving the Problem
  98. * Tools everyone understands
  99. * Best practices
  100. * Revision Control
  101. # Emulation
  102. [em-yuh-ley-shuh n]
  103. noun
  104. 1. effort or desire to equal or excel others.
  105. 2. [Obsolete]. jealous rivalry.
  106. 3. [IT] virutal machines
  107. # Emulation
  108. Emulating a complex system using a simple analog.
  109. # Emulation
  110. Don't try this in production.
  111. # Emulation
  112. * For purposes of Education Only
  113. * "Reducto ad absurdum"
  114. * What is the smallest possible environment that could possibly work?
  115. # Emulation
  116. * Vagrant
  117. * Docker
  118. # Emulation
  119. * Vagrant Guests on my laptop
  120. * Docker containers for "managed hosts"
  121. ( Demo 1 )
  122. # About Ansible
  123. * The Name
  124. * The Configuration Management Tool
  125. ( ddg )
  126. # About Ansible
  127. * Fictional "superluminal" radio
  128. * Faster than light
  129. * quantum entanglement
  130. * bla bla bla
  131. # About Ansible
  132. * Orson Scott Card
  133. * Enders Game
  134. * Block buster movie 2013
  135. * Book 1977
  136. # About Ansible
  137. * Ursula LeGuin
  138. * Rocannan`s World
  139. * Book 1966
  140. * Left Hand of Darkness
  141. * Short stories
  142. # About Ansible
  143. * A tool for system configuration management
  144. * Pythonic
  145. # About Ansible
  146. ## Alternatives
  147. * A bunch of scripts using scp and ssh in a loop
  148. * A slightly smaller set of scripts using pscp and pssh
  149. # About Ansible
  150. ## Alternatives
  151. * cf-engine
  152. * puppet
  153. * rdist
  154. * chef
  155. * salt stack
  156. * re(x)
  157. # About Ansible
  158. ## Alternatives
  159. * docker
  160. * Virtualization
  161. * VMWare/VirtualBox/OpenStack/AWS/"other"
  162. # About Ansible
  163. * Push vs pull
  164. * "Masterless"
  165. * ansible-pull
  166. # About Ansible
  167. ## Requirements
  168. * Manager
  169. * Where the ansible command line is run
  170. # About Ansible
  171. ## Requirements
  172. * Targets
  173. * the managed hosts
  174. # About Ansible
  175. ## Manager Requirements
  176. * Modern Linux (about 2005 or so)
  177. * Ansible package
  178. * Package management
  179. * Revision control (git)
  180. # About Ansible
  181. ## Targets Requirements
  182. * The Managed Hosts
  183. * Python 2.3 or better (a json module)
  184. * sshd
  185. * Some login user
  186. * sudo/su if needed.
  187. # About Ansible
  188. * Two was of using it
  189. * ansible (adhoc)
  190. # About Ansible
  191. * Two was of using it
  192. * ansible-playbook (playbook)
  193. # About Ansible
  194. * ad hoc.
  195. * run a simple module "task" on some list of hosts
  196. # About Ansible
  197. * ansible-playbook
  198. * Run a set of related tasks over a lists of
  199. # About Ansible
  200. * Inventory
  201. * Modules
  202. * Playbooks
  203. # About Ansible
  204. * Inventory
  205. * the list managed systems
  206. * with grouping and so on
  207. # Inventory
  208. * Can be plugged into your cloud service
  209. * Or "just a file" with some structure.
  210. ( Look at a simple file )
  211. # About Ansible
  212. * [Modules](http://docs.ansible.com/ansible/modules_by_category.html)
  213. * The things ansible can do
  214. ( look at the list of modules )
  215. # About Ansible
  216. * Playbooks
  217. * instructions for ansible-playbook
  218. * YAML format
  219. # Finish your environmnt
  220. Ask me for your own personal IP address
  221. ssh vagrant@yourip
  222. cp -r /vagrant class
  223. cd class
  224. source environment
  225. # Emulated Network
  226. * Vagrant guest
  227. * five target 'servers'.
  228. # Look at our environment
  229. env | grep ANSIBLE
  230. # What are the names of your managed hosts?
  231. cat etc/ansible/hosts
  232. Note the funny names for the hosts. Those are actually the short names for
  233. docker containers.
  234. # Count the number of files in /etc on the class servers
  235. ansible class -m shell -a 'ls /etc | wc -l'
  236. # Add db and web and app groups to the hosts file
  237. Two nodes in db and two in web and an app group made by including the other two groups
  238. vi etc/ansible/host
  239. When done it might look something like this. Be suue
  240. localhost
  241. [class]
  242. daa87bc9f63c
  243. e4d3a8708d36
  244. d17ad6801c24
  245. f463acd92e46
  246. 0f3514a36b97
  247. [db]
  248. daa87bc9f63c
  249. e4d3a8708d36
  250. [web]
  251. d17ad6801c24
  252. f463acd92e46
  253. [app:children]
  254. db
  255. web
  256. # Host Patterns
  257. Ansible supports a pretty complex host pattern language
  258. ansible app -m ping
  259. ansible class:\!db -m ping
  260. ansible *e* -m shell uptime
  261. # What Facts do we have?
  262. ansible class:\!app -m setup | less
  263. # Run as user root
  264. ansible class -m script -a bin/i_am_root
  265. # A Playbook
  266. * install and configure NTP