![Page 1: RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE … · RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE AND VAGRANT Aleš Dujíček, Red Hat PyCon Israel 2. - 3. 5. 2016](https://reader031.vdocuments.us/reader031/viewer/2022022015/5b58e72d7f8b9a88698cc82c/html5/thumbnails/1.jpg)
RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE AND VAGRANT
Aleš Dujíček, Red HatPyCon Israel2. - 3. 5. 2016
![Page 2: RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE … · RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE AND VAGRANT Aleš Dujíček, Red Hat PyCon Israel 2. - 3. 5. 2016](https://reader031.vdocuments.us/reader031/viewer/2022022015/5b58e72d7f8b9a88698cc82c/html5/thumbnails/2.jpg)
2
SPACEWALKSystem management tool
VAGRANTVM management tool
ANSIBLEConfiguration
management tool
INTRODUCTION
![Page 3: RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE … · RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE AND VAGRANT Aleš Dujíček, Red Hat PyCon Israel 2. - 3. 5. 2016](https://reader031.vdocuments.us/reader031/viewer/2022022015/5b58e72d7f8b9a88698cc82c/html5/thumbnails/3.jpg)
3
VAGRANT
● VM management tool● Quick and easy to start, use and destroy VMs
● vagrant up● vagrant ssh● vagrant destroy
● Providers: libvirt, virtualbox, docker, …● Provisioning: shell, ansible, chef, puppet, …
![Page 4: RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE … · RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE AND VAGRANT Aleš Dujíček, Red Hat PyCon Israel 2. - 3. 5. 2016](https://reader031.vdocuments.us/reader031/viewer/2022022015/5b58e72d7f8b9a88698cc82c/html5/thumbnails/4.jpg)
4
VAGRANT BOXES
● https://atlas.hashicorp.com/boxes/search● box.img
● Libvirt image● Vagrantfile
● default configuration● metadata.json
● tar czf x.box metadata.json Vagrantfile box.img
{ "provider" : "libvirt", "format" : "qcow2", "virtual_size" : 6 }
![Page 5: RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE … · RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE AND VAGRANT Aleš Dujíček, Red Hat PyCon Israel 2. - 3. 5. 2016](https://reader031.vdocuments.us/reader031/viewer/2022022015/5b58e72d7f8b9a88698cc82c/html5/thumbnails/5.jpg)
5
VAGRANTFILE
● Ruby script● Configuration of VM
Vagrant.configure(2) do |config|
config.vm.box = "Centos"
config.vm.provision "shell", inline: <<-SHELL yum update -y yum install -y httpd SHELL
end
![Page 6: RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE … · RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE AND VAGRANT Aleš Dujíček, Red Hat PyCon Israel 2. - 3. 5. 2016](https://reader031.vdocuments.us/reader031/viewer/2022022015/5b58e72d7f8b9a88698cc82c/html5/thumbnails/6.jpg)
6
ANSIBLE
● Configuration management tool● Needs only SSH and Python● Ad-hoc command
● $ ansible localhost -m ping● Playbooks and inventories● Lot of modules
● $ ansible-doc --list
![Page 7: RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE … · RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE AND VAGRANT Aleš Dujíček, Red Hat PyCon Israel 2. - 3. 5. 2016](https://reader031.vdocuments.us/reader031/viewer/2022022015/5b58e72d7f8b9a88698cc82c/html5/thumbnails/7.jpg)
7
ANSIBLE PLAYBOOKS
● YAML formatted files● Describes hosts, variables, roles, and tasks ● Run
$ ansible-playbook playbook.yml
---- hosts: all tasks:
- name: Install git yum: git state: present
- name: ……
![Page 8: RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE … · RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE AND VAGRANT Aleš Dujíček, Red Hat PyCon Israel 2. - 3. 5. 2016](https://reader031.vdocuments.us/reader031/viewer/2022022015/5b58e72d7f8b9a88698cc82c/html5/thumbnails/8.jpg)
8
ANSIBLE INVENTORY
● INI formatted file● Describes groups of hosts
$ ansible dbservers -i inventory -m ping
s1.example.com
[webservers]www1.example.comwww2.example.com
[dbservers]db1.example.com
![Page 9: RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE … · RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE AND VAGRANT Aleš Dujíček, Red Hat PyCon Israel 2. - 3. 5. 2016](https://reader031.vdocuments.us/reader031/viewer/2022022015/5b58e72d7f8b9a88698cc82c/html5/thumbnails/9.jpg)
9
VAGRANT WITH ANSIBLE
● Vagrantfile + playbook
Vagrant.configure(2) do |config|
config.vm.box = "Fedora23"
config.vm.provision "ansible" do |ansible| ansible.playbook = "playbook.yml" end
end
![Page 10: RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE … · RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE AND VAGRANT Aleš Dujíček, Red Hat PyCon Israel 2. - 3. 5. 2016](https://reader031.vdocuments.us/reader031/viewer/2022022015/5b58e72d7f8b9a88698cc82c/html5/thumbnails/10.jpg)
10
![Page 11: RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE … · RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE AND VAGRANT Aleš Dujíček, Red Hat PyCon Israel 2. - 3. 5. 2016](https://reader031.vdocuments.us/reader031/viewer/2022022015/5b58e72d7f8b9a88698cc82c/html5/thumbnails/11.jpg)
11
![Page 12: RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE … · RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE AND VAGRANT Aleš Dujíček, Red Hat PyCon Israel 2. - 3. 5. 2016](https://reader031.vdocuments.us/reader031/viewer/2022022015/5b58e72d7f8b9a88698cc82c/html5/thumbnails/12.jpg)
12
![Page 13: RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE … · RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE AND VAGRANT Aleš Dujíček, Red Hat PyCon Israel 2. - 3. 5. 2016](https://reader031.vdocuments.us/reader031/viewer/2022022015/5b58e72d7f8b9a88698cc82c/html5/thumbnails/13.jpg)
13
![Page 14: RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE … · RUNNING UPSTREAM SPACEWALK TESTS USING ANSIBLE AND VAGRANT Aleš Dujíček, Red Hat PyCon Israel 2. - 3. 5. 2016](https://reader031.vdocuments.us/reader031/viewer/2022022015/5b58e72d7f8b9a88698cc82c/html5/thumbnails/14.jpg)
THANK YOU
plus.google.com/+RedHat
youtube.com/user/RedHatVideos
facebook.com/redhatinc
twitter.com/RedHatNewslinkedin.com/company/red-hat