Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ansible hors des sentiers battus

Ansible hors des sentiers battus

Ansible permet de gérer le déploiement et la configuration d’un parc de machines. Si vous avez fait d’autres choix pour remplir ce rôle, sachez qu’Ansible peut encore vous faciliter la vie de bien des manières. Venez découvrir ses multiples facettes. Vous apprendrez comment collaborer efficacement avec Vagrant, Packer, Terraform, Puppet, Chef, traverser des serveurs de rebond et d’autres trucs et astuces qui feront à coup sûr d’Ansible votre nouveau couteau suisse d’administration.

4cf671f39b4ebb65f98ee41842ad71fe?s=128

Aurélien Maury

April 21, 2016
Tweet

More Decks by Aurélien Maury

Other Decks in Technology

Transcript

  1. #DevoxxFR #ansibleRocks 1 Aurélien Maury Ansible hors des sentiers battus

  2. #DevoxxFR #ansibleRocks whoami 2

  3. #DevoxxFR #ansibleRocks whoami 2

  4. #DevoxxFR #ansibleRocks uname 3 @YesWeScale

  5. #DevoxxFR #ansibleRocks Agenda 4

  6. #DevoxxFR #ansibleRocks Elevator pitch 5

  7. #DevoxxFR #ansibleRocks Python 6

  8. #DevoxxFR #ansibleRocks Orchestration 7

  9. #DevoxxFR #ansibleRocks Configuration 8

  10. #DevoxxFR #ansibleRocks Idempotence 9

  11. #DevoxxFR #ansibleRocks Sans agent 10

  12. #DevoxxFR #ansibleRocks SSH 11

  13. #DevoxxFR #ansibleRocks « Getting started » 12

  14. #DevoxxFR #ansibleRocks « Getting started » 12 ansible-playbook

  15. #DevoxxFR #ansibleRocks OK ! 13

  16. #DevoxxFR #ansibleRocks OK ! 13

  17. #DevoxxFR #ansibleRocks SSH-fu 14

  18. #DevoxxFR #ansibleRocks SSH-fu 15 # $HOME/.ssh/config Host bastion Hostname 84.39.41.33

    User admin IdentityFile ~/.ssh/bastion_key Host 192.168.47.* ProxyCommand ssh -W %h:%p bastion User admin IdentityFile ~/.ssh/zone_key Host * ControlMaster auto ControlPath ~/.ssh/mux-%r@%h:%p ControlPersist 15m
  19. #DevoxxFR #ansibleRocks SSH-fu 16 # $HOME/.ssh/config Host bastion Hostname 84.39.41.33

    User admin IdentityFile ~/.ssh/bastion_key Host 192.168.47.* ProxyCommand ssh -W %h:%p bastion User admin IdentityFile ~/.ssh/zone_key Host * ControlMaster auto ControlPath ~/.ssh/mux-%r@%h:%p ControlPersist 15m
  20. #DevoxxFR #ansibleRocks SSH-fu 17 # $HOME/.ssh/config Host bastion Hostname 84.39.41.33

    User admin IdentityFile ~/.ssh/bastion_key Host 192.168.47.* ProxyCommand ssh -W %h:%p bastion User admin IdentityFile ~/.ssh/zone_key Host * ControlMaster auto ControlPath ~/.ssh/mux-%r@%h:%p ControlPersist 15m
  21. #DevoxxFR #ansibleRocks SSH-fu 18 # $WORKSPACE/ssh.cfg Host bastion Hostname 84.39.41.33

    User admin IdentityFile ~/.ssh/bastion_key Host 192.168.47.* ProxyCommand ssh -W %h:%p -F ssh.cfg bastion User admin IdentityFile ~/.ssh/zone_key Host * ControlMaster auto ControlPath ~/.ssh/mux-%r@%h:%p ControlPersist 15m
  22. #DevoxxFR #ansibleRocks Hosts 19

  23. #DevoxxFR #ansibleRocks Host Inventory 20 [web_servers] 192.168.47.11 192.168.47.12 192.168.47.13 [db_servers]

    192.168.47.10 [production:children] web_servers db_servers [production:vars] ansible_ssh_user=admin ansible_ssh_private_key_file=/home/ops/.ssh/id_rsa.prod
  24. #DevoxxFR #ansibleRocks Dynamic Inventory 21

  25. #DevoxxFR #ansibleRocks Dynamic Inventory 21 ansible --inventory-file=./static_inventory

  26. #DevoxxFR #ansibleRocks Dynamic Inventory 21 ansible --inventory-file=./static_inventory ansible --inventory-file=./executable_returning_json

  27. #DevoxxFR #ansibleRocks Dynamic Inventory 22 --list { "databases" : {

    "hosts" : [ "host1.example.com", "host2.example.com" ], "vars" : { "a" : true } }, "webservers" : [ "host2.example.com", "host3.example.com" ], "atlanta" : { "hosts" : [ "host1.example.com", "host4.example.com"], "vars" : { "b" : false }, "children": [ "marietta", "5points" ] }, "marietta" : [ "host6.example.com" ] }
  28. #DevoxxFR #ansibleRocks Dynamic Inventory 23 --host $HOST { "favcolor" :

    "red", "ntpserver" : "wolf.example.com", "monitoring" : "pack.example.com" }
  29. #DevoxxFR #ansibleRocks Dynamic Inventory 24

  30. #DevoxxFR #ansibleRocks One more thing 25 La confiance n’exclut pas

    le contrôle.
  31. #DevoxxFR #ansibleRocks Modules 26

  32. #DevoxxFR #ansibleRocks Il y a sûrement un module pour ça

    27
  33. #DevoxxFR #ansibleRocks Il y a sûrement un module pour ça

    27 Cloud - Amazon, Cloudstack, Openstack, VMWare, DO
  34. #DevoxxFR #ansibleRocks Il y a sûrement un module pour ça

    27 Cloud - Amazon, Cloudstack, Openstack, VMWare, DO Clustering - consul, zookeeper
  35. #DevoxxFR #ansibleRocks Il y a sûrement un module pour ça

    27 Cloud - Amazon, Cloudstack, Openstack, VMWare, DO Clustering - consul, zookeeper Commands - shell, script, expect
  36. #DevoxxFR #ansibleRocks Il y a sûrement un module pour ça

    27 Cloud - Amazon, Cloudstack, Openstack, VMWare, DO Clustering - consul, zookeeper Commands - shell, script, expect Database - mysql, postgresql, redis, riak
  37. #DevoxxFR #ansibleRocks Il y a sûrement un module pour ça

    27 Cloud - Amazon, Cloudstack, Openstack, VMWare, DO Clustering - consul, zookeeper Commands - shell, script, expect Database - mysql, postgresql, redis, riak Files - copy, fetch, lineinfile, template, unarchive
  38. #DevoxxFR #ansibleRocks Il y a sûrement un module pour ça

    27 Cloud - Amazon, Cloudstack, Openstack, VMWare, DO Clustering - consul, zookeeper Commands - shell, script, expect Database - mysql, postgresql, redis, riak Files - copy, fetch, lineinfile, template, unarchive Messaging - rabbitmq_[binding, exchange, queue, ...]
  39. #DevoxxFR #ansibleRocks Il y a sûrement un module pour ça

    27 Cloud - Amazon, Cloudstack, Openstack, VMWare, DO Clustering - consul, zookeeper Commands - shell, script, expect Database - mysql, postgresql, redis, riak Files - copy, fetch, lineinfile, template, unarchive Messaging - rabbitmq_[binding, exchange, queue, ...] Monitoring - zabbix, nagios, sensu, monit, datadog
  40. #DevoxxFR #ansibleRocks Il y a sûrement un module pour ça

    27 Cloud - Amazon, Cloudstack, Openstack, VMWare, DO Clustering - consul, zookeeper Commands - shell, script, expect Database - mysql, postgresql, redis, riak Files - copy, fetch, lineinfile, template, unarchive Messaging - rabbitmq_[binding, exchange, queue, ...] Monitoring - zabbix, nagios, sensu, monit, datadog Network - A10, F5, Openswitch, cumulus, get_url
  41. #DevoxxFR #ansibleRocks Il y a sûrement un module pour ça

    27 Cloud - Amazon, Cloudstack, Openstack, VMWare, DO Clustering - consul, zookeeper Commands - shell, script, expect Database - mysql, postgresql, redis, riak Files - copy, fetch, lineinfile, template, unarchive Messaging - rabbitmq_[binding, exchange, queue, ...] Monitoring - zabbix, nagios, sensu, monit, datadog Network - A10, F5, Openswitch, cumulus, get_url Notification - jabber, slack, mail, irc, hipchat
  42. #DevoxxFR #ansibleRocks Il y a sûrement un module pour ça

    27 Cloud - Amazon, Cloudstack, Openstack, VMWare, DO Clustering - consul, zookeeper Commands - shell, script, expect Database - mysql, postgresql, redis, riak Files - copy, fetch, lineinfile, template, unarchive Messaging - rabbitmq_[binding, exchange, queue, ...] Monitoring - zabbix, nagios, sensu, monit, datadog Network - A10, F5, Openswitch, cumulus, get_url Notification - jabber, slack, mail, irc, hipchat Packaging - apt, yum, pip, bower, npm, homebrew
  43. #DevoxxFR #ansibleRocks Il y a sûrement un module pour ça

    27 Cloud - Amazon, Cloudstack, Openstack, VMWare, DO Clustering - consul, zookeeper Commands - shell, script, expect Database - mysql, postgresql, redis, riak Files - copy, fetch, lineinfile, template, unarchive Messaging - rabbitmq_[binding, exchange, queue, ...] Monitoring - zabbix, nagios, sensu, monit, datadog Network - A10, F5, Openswitch, cumulus, get_url Notification - jabber, slack, mail, irc, hipchat Packaging - apt, yum, pip, bower, npm, homebrew Source control - git, gitlab, hg, subversion
  44. #DevoxxFR #ansibleRocks Il y a sûrement un module pour ça

    27 Cloud - Amazon, Cloudstack, Openstack, VMWare, DO Clustering - consul, zookeeper Commands - shell, script, expect Database - mysql, postgresql, redis, riak Files - copy, fetch, lineinfile, template, unarchive Messaging - rabbitmq_[binding, exchange, queue, ...] Monitoring - zabbix, nagios, sensu, monit, datadog Network - A10, F5, Openswitch, cumulus, get_url Notification - jabber, slack, mail, irc, hipchat Packaging - apt, yum, pip, bower, npm, homebrew Source control - git, gitlab, hg, subversion System - known_host, authorized_key, user, group
  45. #DevoxxFR #ansibleRocks Il y a sûrement un module pour ça

    27 Cloud - Amazon, Cloudstack, Openstack, VMWare, DO Clustering - consul, zookeeper Commands - shell, script, expect Database - mysql, postgresql, redis, riak Files - copy, fetch, lineinfile, template, unarchive Messaging - rabbitmq_[binding, exchange, queue, ...] Monitoring - zabbix, nagios, sensu, monit, datadog Network - A10, F5, Openswitch, cumulus, get_url Notification - jabber, slack, mail, irc, hipchat Packaging - apt, yum, pip, bower, npm, homebrew Source control - git, gitlab, hg, subversion System - known_host, authorized_key, user, group Windows - trucs windows inconnus de moi
  46. #DevoxxFR #ansibleRocks Appel à un module 28 - name: un

    joli titre c’est mieux apt: pkg="tmux" state=present update_cache=yes - name: un joli titre c’est mieux apt: pkg="screen" state=present
  47. #DevoxxFR #ansibleRocks with_items 29 - name: un joli titre c’est

    mieux apt: pkg="{{ item }}" state=present update_cache=yes with_items: - tmux - screen
  48. #DevoxxFR #ansibleRocks with_items 30 - name: add several users user:

    name={{ item.name }} state=present groups={{ item.groups }} with_items: - { name: 'testuser1', groups: 'wheel' } - { name: 'testuser2', groups: 'root' }
  49. #DevoxxFR #ansibleRocks with_* 31 with_file: - file_1 - file_2 with_fileglob:

    - files/*.yml with_together: - ['a','b'] - [1,2] with_subelements, with_sequence, with_random_choice, with_indexed_items, with_dict
  50. #DevoxxFR #ansibleRocks Donnez vie à vos snippets 32

  51. #DevoxxFR #ansibleRocks Donnez vie à vos snippets 32 Faire un

    module Ansible ?
  52. #DevoxxFR #ansibleRocks Donnez vie à vos snippets 32 15 lignes

    de Python Faire un module Ansible ?
  53. #DevoxxFR #ansibleRocks Donnez vie à vos snippets 32 15 lignes

    de Python Faire un module Ansible ? Installer un module Ansible ?
  54. #DevoxxFR #ansibleRocks Donnez vie à vos snippets 32 15 lignes

    de Python Faire un module Ansible ? posez le dans ./library Installer un module Ansible ?
  55. #DevoxxFR #ansibleRocks Roles 33

  56. #DevoxxFR #ansibleRocks Structure 34 . ├── README.md ├── defaults │

    └── main.yml --> variables par défaut ├── files --> fichiers statiques ├── handlers │ └── main.yml --> handlers ├── meta │ └── main.yml --> fiche d'info et dépendances ├── tasks │ └── main.yml --> tâches (appels de modules) ├── templates --> templates Jinja2 ├── tests │ ├── inventory │ └── test.yml └── vars └── main.yml --> variables fortes
  57. #DevoxxFR #ansibleRocks Structure 34 . ├── README.md ├── defaults │

    └── main.yml --> variables par défaut ├── files --> fichiers statiques ├── handlers │ └── main.yml --> handlers ├── meta │ └── main.yml --> fiche d'info et dépendances ├── tasks │ └── main.yml --> tâches (appels de modules) ├── templates --> templates Jinja2 ├── tests │ ├── inventory │ └── test.yml └── vars └── main.yml --> variables fortes ansible-galaxy init mon_role_amoi
  58. #DevoxxFR #ansibleRocks ansible-galaxy 35

  59. #DevoxxFR #ansibleRocks ansible-galaxy 35 https://galaxy.ansible.com

  60. #DevoxxFR #ansibleRocks ansible-galaxy 35 https://galaxy.ansible.com ansible-galaxy install yatesr.timezone

  61. #DevoxxFR #ansibleRocks ansible-galaxy 36 # requirements.yml - src: yatesr.timezone -

    src: https://github.com/bennojoy/nginx - src: https://github.com/bennojoy/nginx version: master name: nginx_role - src: https://some.webserver.example.com/files/master.tar.gz name: http-role
  62. #DevoxxFR #ansibleRocks ansible-galaxy 36 # requirements.yml - src: yatesr.timezone -

    src: https://github.com/bennojoy/nginx - src: https://github.com/bennojoy/nginx version: master name: nginx_role - src: https://some.webserver.example.com/files/master.tar.gz name: http-role ansible-galaxy install -r requirements.yml
  63. #DevoxxFR #ansibleRocks Variables 37

  64. #DevoxxFR #ansibleRocks YAML 38 —-- simplest_num: 42 simplest_str: "Terry Pratchett"

    # Qui lit les commentaires de toutes façons ? some_list: - "DON'T THINK OF IT AS DYING" - "JUST THINK OF IT AS" - "LEAVING EARLY TO AVOID THE RUSH" some_dict: key: "value" other_key: 10 list_of_dict: - { indentation: "is", the_key: "si si" }
  65. #DevoxxFR #ansibleRocks YAML 39 —-- simplest_num: 42 simplest_str: "Terry Pratchett"

    # Qui lit les commentaires de toutes façons ? some_list: - "DON'T THINK OF IT AS DYING" - "JUST THINK OF IT AS" - "LEAVING EARLY TO AVOID THE RUSH" some_dict: key: "value" other_key: 10 list_of_dict: - { indentation: "is", the_key: "si si" }
  66. #DevoxxFR #ansibleRocks YAML 40 —-- simplest_num: 42 simplest_str: "Terry Pratchett"

    # Qui lit les commentaires de toutes façons ? some_list: - "DON'T THINK OF IT AS DYING" - "JUST THINK OF IT AS" - "LEAVING EARLY TO AVOID THE RUSH" some_dict: key: "value" other_key: 10 list_of_dict: - indentation: "is" the_key: "si si"
  67. #DevoxxFR #ansibleRocks YAML 41 {{ playbook_dir }} {{ inventory_dir }}

  68. #DevoxxFR #ansibleRocks Facts 42 ansible -m setup localhost localhost |

    SUCCESS => { "ansible_facts": { "ansible_all_ipv4_addresses": [ "192.168.42.2", "192.168.99.1" ], "ansible_all_ipv6_addresses": [ "fe80::4e8d:79ff:fee8:54fe%en1", "fe80::f0ad:11ff:fee9:fcc8%awdl0" ], "ansible_architecture": "x86_64", "ansible_awdl0": { "device": "awdl0", "flags": [ "UP", "BROADCAST", "RUNNING", "PROMISC", "SIMPLEX", "MULTICAST"
  69. #DevoxxFR #ansibleRocks Facts 43 ansible_distribution ansible_distribution_major_version ansible_default_ipv4.address ansible_eth0.ipv4.address ansible_processor_cores ansible_hostname

    ansible_mounts ansible_interfaces [...]
  70. #DevoxxFR #ansibleRocks Fact caching 44 # ansible.cfg [defaults] gathering =

    smart fact_caching = redis fact_caching_timeout = 7200
  71. #DevoxxFR #ansibleRocks Fact caching 45 # ansible.cfg [defaults] gathering =

    smart fact_caching = jsonfile fact_caching_connection = /tmp/facts_cache fact_caching_timeout = 7200
  72. #DevoxxFR #ansibleRocks Set_fact 46 —-- - hosts: target_group become: yes

    pre_tasks: - shell: > {{ playbook_dir }}/scripts/xml2yaml.py xml/* register: yaml_out
  73. #DevoxxFR #ansibleRocks Set_fact 46 —-- - hosts: target_group become: yes

    pre_tasks: - shell: > {{ playbook_dir }}/scripts/xml2yaml.py xml/* register: yaml_out "--- styles: - grindcore - disco - punk"
  74. #DevoxxFR #ansibleRocks Set_fact 46 —-- - hosts: target_group become: yes

    pre_tasks: - shell: > {{ playbook_dir }}/scripts/xml2yaml.py xml/* register: yaml_out "--- styles: - grindcore - disco - punk" - set_fact: table_oauth: "{{ yaml_out.stdout | from_yaml }}"
  75. #DevoxxFR #ansibleRocks Set_fact 47 —-- - hosts: target_group become: yes

    pre_tasks: - include: custom_facts.yml
  76. #DevoxxFR #ansibleRocks Précédence 48 role defaults inventory vars inventory group_vars

    inventory host_vars playbook group_vars playbook host_vars host facts registered vars set_facts play vars play vars_prompt play vars_files role and include vars block vars (seulement pour les tâches du bloc) task vars (seulement pour la tâche) extra vars (ultime)
  77. #DevoxxFR #ansibleRocks Précédence 49 role defaults inventory vars inventory group_vars

    inventory host_vars playbook group_vars playbook host_vars host facts registered vars set_facts play vars play vars_prompt play vars_files role and include vars block vars (seulement pour les tâches du bloc) task vars (seulement pour la tâche) extra vars (ultime)
  78. #DevoxxFR #ansibleRocks Rebonjour M. Anderson 50

  79. #DevoxxFR #ansibleRocks Agent-like 51

  80. #DevoxxFR #ansibleRocks Agent-like 51 ansible-playbook

  81. #DevoxxFR #ansibleRocks 52 Agent-like

  82. #DevoxxFR #ansibleRocks 52 git push Agent-like

  83. #DevoxxFR #ansibleRocks 53 Agent-like

  84. #DevoxxFR #ansibleRocks 53 cron + ansible-pull Agent-like

  85. #DevoxxFR #ansibleRocks Vagrant 54

  86. #DevoxxFR #ansibleRocks Vagrant provisioner remote 55 config.vm.provision "ansible" do |ansible|

    ansible.groups = { "web_servers" => ["vm_one", "vm_two"], "db_servers" => ["vm_three"], "production:children" => [ "web_servers", "db_servers" ], "all_groups:children" => ["production"] } ansible.playbook = "upgrade_stack.yml" end
  87. #DevoxxFR #ansibleRocks 56 config.vm.provision "ansible" do |ansible| ansible.groups = {

    "web_servers" => ["vm_one", "vm_two"], "db_servers" => ["vm_three"], "production:children" => [ "web_servers", "db_servers" ], "all_groups:children" => ["production"] } ansible.playbook = "upgrade_stack.yml" end Vagrant provisioner remote
  88. #DevoxxFR #ansibleRocks 57 config.vm.provision "ansible" do |ansible| ansible.groups = {

    "web_servers" => ["vm_one", "vm_two"], "db_servers" => ["vm_three"], "production:children" => [ "web_servers", "db_servers" ], "all_groups:children" => ["production"] } ansible.playbook = "upgrade_stack.yml" end Vagrant provisioner remote
  89. #DevoxxFR #ansibleRocks 58 config.vm.provision "ansible_local" do |ansible| ansible.playbook = "upgrade_stack.yml"

    end Vagrant provisioner local
  90. #DevoxxFR #ansibleRocks Packer 59

  91. #DevoxxFR #ansibleRocks Packer : Elevator pitch 60

  92. #DevoxxFR #ansibleRocks Packer : Elevator pitch 60 Boot VM •

    OpenStack • AWS • Docker • Qemu • GCE • …
  93. #DevoxxFR #ansibleRocks Packer : Elevator pitch 60 Boot VM Provision

    • OpenStack • AWS • Docker • Qemu • GCE • … • Puppet • Saltstack • Chef • Ansible • Shell • …
  94. #DevoxxFR #ansibleRocks Packer : Elevator pitch 60 Boot VM Provision

    Snapshot • OpenStack • AWS • Docker • Qemu • GCE • … • Puppet • Saltstack • Chef • Ansible • Shell • …
  95. #DevoxxFR #ansibleRocks build-me.json 61 "provisioners": [
 {
 "type": "file",
 "source":

    "ansible/requirements.yml",
 "destination": "/tmp/requirements.yml"
 },
 {
 "type": "shell",
 "scripts": [
 "scripts/ansible-seed.sh"
 ]
 },
 {
 "type": "ansible-local",
 "playbook_dir": "ansible",
 "playbook_file": "ansible/bootstrap.yml"
 } }
  96. #DevoxxFR #ansibleRocks build-me.json 62 "provisioners": [
 {
 "type": "file",
 "source":

    "ansible/requirements.yml",
 "destination": "/tmp/requirements.yml"
 },
 {
 "type": "shell",
 "scripts": [
 "scripts/ansible-seed.sh"
 ]
 },
 {
 "type": "ansible-local",
 "playbook_dir": "ansible",
 "playbook_file": "ansible/bootstrap.yml"
 } }
  97. #DevoxxFR #ansibleRocks build-me.json 63 "provisioners": [
 {
 "type": "file",
 "source":

    "ansible/requirements.yml",
 "destination": "/tmp/requirements.yml"
 },
 {
 "type": "shell",
 "scripts": [
 "scripts/ansible-seed.sh"
 ]
 },
 {
 "type": "ansible-local",
 "playbook_dir": "ansible",
 "playbook_file": "ansible/bootstrap.yml"
 } }
  98. #DevoxxFR #ansibleRocks build-me.json 64 "provisioners": [
 {
 "type": "file",
 "source":

    "ansible/requirements.yml",
 "destination": "/tmp/requirements.yml"
 },
 {
 "type": "shell",
 "scripts": [
 "scripts/ansible-seed.sh"
 ]
 },
 {
 "type": "ansible-local",
 "playbook_dir": "ansible",
 "playbook_file": "ansible/bootstrap.yml"
 } }
  99. #DevoxxFR #ansibleRocks Interactions 65

  100. #DevoxxFR #ansibleRocks Le maître mot 66

  101. #DevoxxFR #ansibleRocks Logique 67

  102. #DevoxxFR #ansibleRocks Logique 67 SSH => Ansible

  103. #DevoxxFR #ansibleRocks Logique 67 SSH => Ansible (ou Salt-SSH)

  104. #DevoxxFR #ansibleRocks Terraform 68

  105. #DevoxxFR #ansibleRocks Points de greffe 69 # playbook.yml - shell:

    cat terraform.tfstate register: raw_tfstate - set_facts: tfstate: "{{ raw_tfstate.stdout | from_json }}"
  106. #DevoxxFR #ansibleRocks Points de greffe 69 # playbook.yml - shell:

    cat terraform.tfstate register: raw_tfstate - set_facts: tfstate: "{{ raw_tfstate.stdout | from_json }}" tfstate.modules[1].resources['aws_route53_record.elb_cgate'].primary.attributes.zone_id
  107. #DevoxxFR #ansibleRocks Points de greffe 70

  108. #DevoxxFR #ansibleRocks Points de greffe 70 # main.tf resource "aws_route53_record"

    "monitor" { zone_id = "${var.network.route53_zone_id}" name = "monitor" type = "A" ttl = "300" records = ["${aws_instance.server.private_ip}"] }
  109. #DevoxxFR #ansibleRocks Points de greffe 70 # main.tf resource "aws_route53_record"

    "monitor" { zone_id = "${var.network.route53_zone_id}" name = "monitor" type = "A" ttl = "300" records = ["${aws_instance.server.private_ip}"] } output "monitor_zone_id" { value = "${aws_route53_record.monitor.zone_id}" }
  110. #DevoxxFR #ansibleRocks Points de greffe 70 # main.tf resource "aws_route53_record"

    "monitor" { zone_id = "${var.network.route53_zone_id}" name = "monitor" type = "A" ttl = "300" records = ["${aws_instance.server.private_ip}"] } output "monitor_zone_id" { value = "${aws_route53_record.monitor.zone_id}" } terraform output monitor_zone_id ZSQ642E3K7JC5
  111. #DevoxxFR #ansibleRocks Points de greffe 71 # playbook.yml - shell:

    cat terraform.tfstate register: raw_tfstate - set_facts: tfstate: "{{ raw_tfstate.stdout | from_json }}" tfstate.modules[1].resources['aws_route53_record.elb_cgate'].primary.attributes.zone_id
  112. #DevoxxFR #ansibleRocks Points de greffe 72

  113. #DevoxxFR #ansibleRocks Points de greffe 72 # playbook.yml - shell:

    terraform output monitor_zone_id register: sh_monitor_zid - set_facts: monitor_zid: "{{ sh_monitor_zid.stdout }}"
  114. #DevoxxFR #ansibleRocks Pensées 73

  115. #DevoxxFR #ansibleRocks Métaphore 74

  116. #DevoxxFR #ansibleRocks Métaphore 74

  117. #DevoxxFR #ansibleRocks Métaphore 74

  118. #DevoxxFR #ansibleRocks Métaphore 74 +

  119. #DevoxxFR #ansibleRocks Métaphore 74 + +

  120. #DevoxxFR #ansibleRocks 75 SYSADMINS because even developers need heroes

  121. #DevoxxFR #ansibleRocks 76

  122. #DevoxxFR #ansibleRocks 76 KEEP CALM AND HACK YOUR WAY

  123. #DevoxxFR #ansibleRocks 77 Des questions ?

  124. #DevoxxFR #ansibleRocks Merci @YesWeScale @aurelienmaury 78

  125. #DevoxxFR #ansibleRocks Merci @YesWeScale @aurelienmaury 78