forked from data.coop/ansible
Merge branch 'add_vagrant_file' of data.coop/ansible into master
This commit is contained in:
commit
ff4a592fe0
24
Vagrantfile
vendored
Normal file
24
Vagrantfile
vendored
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
Vagrant.require_version ">= 1.7.0"
|
||||||
|
|
||||||
|
Vagrant.configure(2) do |config|
|
||||||
|
|
||||||
|
config.vm.define "datacoop" do |datacoop|
|
||||||
|
datacoop.vm.box = "ubuntu/bionic64"
|
||||||
|
datacoop.vm.hostname = "datacoop"
|
||||||
|
datacoop.vm.provider "virtualbox" do |v|
|
||||||
|
v.memory = 4096
|
||||||
|
end
|
||||||
|
datacoop.vm.network "private_network", ip: "192.168.0.42"
|
||||||
|
datacoop.vm.provision "ansible" do |ansible|
|
||||||
|
ansible.verbose = "v"
|
||||||
|
ansible.compatibility_mode = "2.0"
|
||||||
|
ansible.playbook = "playbook.yml"
|
||||||
|
ansible.host_vars = {
|
||||||
|
"datacoop" => {"ansible_python_interpreter" => "/usr/bin/python3.6"}
|
||||||
|
}
|
||||||
|
ansible.groups = {
|
||||||
|
"all" => ["datacoop"]
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
######################################
|
######################################
|
||||||
### Application servers
|
### Application servers
|
||||||
[all_servers]
|
[servers]
|
||||||
10.1.1.198
|
10.1.1.198
|
||||||
10.1.1.199
|
10.1.1.199
|
||||||
|
|
||||||
|
|
28
playbook.yml
28
playbook.yml
|
@ -1,30 +1,8 @@
|
||||||
---
|
---
|
||||||
- hosts: all
|
- hosts: all
|
||||||
gather_facts: False
|
gather_facts: False
|
||||||
|
become: true
|
||||||
|
|
||||||
pre_tasks:
|
|
||||||
- name: install python for Ansible
|
|
||||||
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
|
|
||||||
register: output
|
|
||||||
changed_when: output.stdout != ""
|
|
||||||
- setup:
|
|
||||||
|
|
||||||
- name: "Include host secrets where applicable"
|
|
||||||
hosts: "all"
|
|
||||||
tasks:
|
|
||||||
- include_vars: "host_vars/{{ ansible_nodename }}-secrets.yml"
|
|
||||||
ignore_errors: yes
|
|
||||||
tags:
|
|
||||||
- "always"
|
|
||||||
|
|
||||||
- name: "Run base config on all ubuntu hosts"
|
|
||||||
hosts: "all"
|
|
||||||
become: yes
|
|
||||||
roles:
|
roles:
|
||||||
- "ubuntu_base"
|
- ubuntu_base
|
||||||
|
- docker
|
||||||
- name: "Install docker on all servers"
|
|
||||||
hosts: "all_servers"
|
|
||||||
become: yes
|
|
||||||
roles:
|
|
||||||
- "docker"
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
---
|
---
|
||||||
- import_tasks: base.yml
|
|
||||||
- import_tasks: upgrade.yml
|
- import_tasks: upgrade.yml
|
||||||
|
- import_tasks: base.yml
|
||||||
- import_tasks: users.yml
|
- import_tasks: users.yml
|
||||||
|
|
Loading…
Reference in a new issue