Fixed hosts file. Added secondary dns. Gave docker group permissions to compose. Added variables to hosts file.

This commit is contained in:
2018-03-20 07:20:48 -04:00
parent 745e4652d8
commit 047e8a7a35
5 changed files with 43 additions and 20 deletions

Binary file not shown.

24
hosts
View File

@@ -1,15 +1,15 @@
[standard]
#wiki.wimer.local
#swarm-manager-01.wimer.local
#swarm-manager-02.wimer.local
#swarm-manager-03.wimer.local
#registry.wimer.local
#wrestlingdev-test.wimer.local
#elk.wimer.local
#guacamole.wimer.local
#fileserver.wimer.local
#test2 ansible_host=10.0.0.152
ns ansible_host=10.0.0.204
wiki ansible_host=10.0.0.222 hypervisor=rack1 memory=2048 cpus=2
swarm-manager-01 ansible_host=10.0.0.206 hypervisor=rack1 memory=2048 cpus=2
swarm-manager-02 ansible_host=10.0.0.225 hypervisor=rack2 memory=2048 cpus=2
swarm-manager-03 ansible_host=10.0.0.220 hypervisor=rack2 memory=2048 cpus=2
registry ansible_host=10.0.0.221 hypervisor=rack1 memory=2048 cpus=2
wrestlingdev-test ansible_host=10.0.0.240 hypervisor=rack1 memory=2048 cpus=2
elk ansible_host=10.0.0.224 hypervisor=rack2 memory=4096 cpus=2
guacamole ansible_host=10.0.0.202 hypervisor=rack2 memory=2048 cpus=2
fileserver ansible_host=10.0.0.201 hypervisor=rack2 memory=4096 cpus=2
ns ansible_host=10.0.0.204 hypervisor=rack1 memory=1024 cpus=2
vpn ansible_host=10.0.0.203 hypervisor=rack1 memory=1024 cpus=2
[developer-machines]
codydev ansible_host=10.0.0.207
codydev ansible_host=10.0.0.207 hypervisor=rack2 memory=2048 cpus=2

View File

@@ -12,18 +12,30 @@
api_user: "{{ proxmox_user }}"
api_password: "{{ proxmox_password }}"
api_host: "{{ proxmox_host }}"
clone : "{{ ubuntu_template_vm_name }}"
name : '{{ inventory_hostname }}'
node : 'rack2'
storage : 'SSD1'
format : 'qcow2'
timeout : 3000
clone: "{{ ubuntu_template_vm_name }}"
name: '{{ inventory_hostname }}'
node: '{{ hypervisor }}'
storage: 'SSD1'
format: 'qcow2'
timeout: 3000
register: cloned
- name: Wait 10 seconds for proxmox to register the new node
wait_for: timeout=10
delegate_to: localhost
- name: Set resources
delegate_to: localhost
proxmox_kvm:
api_user: "{{ proxmox_user }}"
api_password: "{{ proxmox_password }}"
api_host: "{{ proxmox_host }}"
name: '{{ inventory_hostname }}'
node: '{{ hypervisor }}'
cores: '{{ cpus }}'
memory: '{{ memory }}'
when: cloned.changed
- name: Start VM
delegate_to: localhost
proxmox_kvm:
@@ -31,7 +43,7 @@
api_password: "{{ proxmox_password }}"
api_host: "{{ proxmox_host }}"
name: '{{ inventory_hostname }}'
node: rack2
node: '{{ hypervisor }}'
state: started
when: cloned.changed

View File

@@ -68,6 +68,7 @@
url: "https://github.com/docker/compose/releases/download/{{docker_compose_version_to_install}}/docker-compose-{{ ansible_system }}-{{ ansible_userspace_architecture }}"
dest: /usr/local/bin/docker-compose
mode: 755
group: docker
- name: Set timezone to NewYork
timezone:
@@ -171,3 +172,13 @@
regexp="^vm.vfs_cache_pressure"
state=present
line="vm.vfs_cache_pressure = 50"
- name: Set hostname
hostname:
name: '{{ inventory_hostname }}'
- name: Fix hosts file
lineinfile: dest=/etc/hosts
regexp="ubuntu"
state=present
line="{{ inventory_hostname }}"

View File

@@ -4,4 +4,4 @@ iface {{ interface_name }} inet static
address {{ ansible_host }}
netmask 255.255.255.0
gateway 10.0.0.1
dns-nameservers 10.0.0.204
dns-nameservers 10.0.0.204 8.8.8.8