Merge branch 'add_vagrant_file' of data.coop/ansible into master

This commit is contained in:
Jesper Hess 2018-06-24 06:28:31 +00:00 committed by Gitea
commit ff4a592fe0
4 changed files with 30 additions and 28 deletions

24
Vagrantfile vendored Normal file
View 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

View file

@ -5,7 +5,7 @@
######################################
### Application servers
[all_servers]
[servers]
10.1.1.198
10.1.1.199

View file

@ -1,30 +1,8 @@
---
- hosts: all
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:
- "ubuntu_base"
- name: "Install docker on all servers"
hosts: "all_servers"
become: yes
roles:
- "docker"
- ubuntu_base
- docker

View file

@ -1,4 +1,4 @@
---
- import_tasks: base.yml
- import_tasks: upgrade.yml
- import_tasks: base.yml
- import_tasks: users.yml