kosssi
Lead dev @cozycloud Love development Like devops And design is so gooood ^^
OWF du 31/10/14
Simon C. @kos_si
valeur: clé
liste:
- un element de la liste
- un second element
liste2: [1, 2, 3]
dictionnaire:
dictionaire2: {'element': 2, 'valeurNull': ~}
inventory
hosts/preprod :
[webservers]
preprod.mon-service.org
[dbservers]
preprod.mon-service.org
[preprod:children]
webservers
dbservers
[webservers]
ws1.mon-service.org
ws1.mon-service.org
18.70.7.81
[dbservers]
db1.mon-service.org [prod:children] webservers dbservers
hosts/prod :
database_name: prod
database_user: kosssi
database_pass: isssok?
prod
preprod
database_name: preprod
database_user: simon
database_pass: 5p8kpZJ5eSQWk3
database_host: db1.service.org
ws1.service.org
database_host: db2.service.org
ws2.mon-service.org
hosts/var_group :
hosts/host_vars :
module
a10_server a10_service_group a10_virtual_server accelerate acl add_host airbrake_deployment alternatives apache2_module apt apt_key apt_repository apt_rpm assemble assert async_status at authorized_key azure bigip_facts bigip_monitor_http bigip_monitor_tcp bigip_node bigip_pool bigip_pool_member bigpanda boundary_meter bzr campfire capabilities cloudformation command composer copy cpanm cron datadog_event debconf debug digital_ocean digital_ocean_domain digital_ocean_sshkey django_manage dnsimple dnsmadeeasy docker docker_image easy_install ec2 ec2_ami ec2_ami_search ec2_asg ec2_eip ec2_elb ec2_elb_lb ec2_facts ec2_group ec2_key ec2_lc ec2_metric_alarm ec2_scaling_policy ec2_snapshot ec2_tag ec2_vol ec2_vpc ejabberd_user elasticache facter fail fetch file filesystem fireball firewalld flowdock gc_storage gce gce_lb gce_net gce_pd gem get_url getent git github_hooks glance_image group group_by grove hg hipchat homebrew homebrew_cask homebrew_tap hostname htpasswd include_vars ini_file irc jabber jboss jira kernel_blacklist keystone_user layman librato_annotation lineinfile linode lldp locale_gen logentries lvg lvol macports mail modprobe mongodb_user monit mount mqtt mysql_db mysql_replication mysql_user mysql_variables nagios netscaler newrelic_deployment nexmo nova_compute nova_keypair npm ohai open_iscsi openbsd_pkg openvswitch_bridge openvswitch_port opkg osx_say ovirt pacman pagerduty pause ping pingdom pip pkgin pkgng pkgutil portage portinstall postgresql_db postgresql_privs postgresql_user quantum_floating_ip quantum_floating_ip_associate quantum_network quantum_router quantum_router_gateway quantum_router_interface quantum_subnet rabbitmq_parameter rabbitmq_plugin rabbitmq_policy rabbitmq_user rabbitmq_vhost raw rax rax_cbs rax_cbs_attachments rax_cdb rax_cdb_database rax_cdb_user rax_clb rax_clb_nodes rax_dns rax_dns_record rax_facts rax_files rax_files_objects rax_identity rax_keypair rax_meta rax_network rax_queue rax_scaling_group rax_scaling_policy rds rds_param_group rds_subnet_group redhat_subscription redis replace rhn_channel rhn_register riak rollbar_deployment route53 rpm_key s3 script seboolean selinux service set_fact setup shell slack slurp sns stackdriver stat subversion supervisorctl svr4pkg swdepot synchronize sysctl template twilio typetalk ufw unarchive uri urpmi user virt vsphere_guest wait_for win_feature win_get_url win_group win_msi win_ping win_service win_stat win_user xattr yum zabbix_maintenance zfs zypper zypper_repository
=
Listes de taches sur des groupes de domaine
hosts/prod :
[webservers]
sharepear.io
site.yml :
- hosts: webservers
vars:
packages: [cowsay, cowthink, sl, figlet]
tasks:
- name: install packages
apt: pkg={{ item }} state=present
with_items: packages
ansible-playbook -i hosts/prod site.yml
- name: install cowsay package
apt: pkg=cowsay state=present
documentation
module
arguments
Variables par défaut
Tâches
Tâches spécifique
Templates
Informations
Tests
site.yml :
- hosts: webservers vars_files: - vars/apt.yml roles: - { role: kosssi.apt, tags: apt }
vars/apt.yml :
apt_install:
- cowsay
- cowthink
- sl
- figlet
ansible-playbook -i hosts/prod site.yml
# Ansible
config.vm.provision "ansible" do |ansible|
ansible.sudo = true
ansible.playbook = "provision/site.yml"
ansible.limit = "vagrant" # hosts group
ansible.inventory_path = "provision/hosts/vagrant"
ansible.verbose = "vvvv"
ansible.tags = "config"
end
ansible-galaxy install kosssi.composer,v1.0.3
requirements.txt :
kosssi.ssh,v1.0.0
kosssi.apt,v1.0.0
kosssi.php,v1.0.0
kosssi.composer,v1.0.3
kosssi.apache,v1.0.0
Ansibles.mysql,v1.0.2
ansible-galaxy install -r requirements.txt --force
[defaults]
# some basic default values...
hostfile = /etc/ansible/hosts
library_path = /usr/share/my_modules/
roles_path = /etc/ansible/roles
sudo_user = root
remote_user = root
ask_sudo_pass = True
ask_pass = True
log_path = /var/log/ansible.log
ansible-galaxy init demo.role
Je me suis mis à adorer le devops et à en faire un max
C'est un plaisir de mettre à jour mon provisioning
Avec quelques exemples on peut facilement apprendre à quelqu'un
Simon C. @kos_si
By kosssi