update docker and postgres installs

This commit is contained in:
2018-01-07 12:43:41 -05:00
parent 771dfabd69
commit bc08842d57
8 changed files with 121 additions and 40 deletions

View File

@@ -11,6 +11,7 @@ services:
POSTGRES_PASSWORD: snqioxni1sw
POSTGRES_USER: xaicorp_admin
POSTGRES_DB: xaicorp_default
PGDATA: /data/xaicorp_pgdata
ports:
- 5432:5432

View File

@@ -21,13 +21,13 @@ services:
# syslog-address: "tcp+tls://logs6.papertrailapp.com:38577"
# tag: "{{.Name}}/{{.ID}}"
logging:
driver: fluentd
options:
fluentd-address: "logs.xai-corp.net:24224"
fluentd-async-connect: 'true'
tag: sslproxy
# logging:
# driver: fluentd# tag: sslproxy
# options:
# fluentd-address: "logs.xai-corp.net:24224"
# fluentd-async-connect: 'true'
# logging:
# driver: syslog
# options:
@@ -54,7 +54,7 @@ services:
networks:
- ingress
- prod-private
# - prod-private
networks:
ingress:

View File

@@ -8,7 +8,7 @@ server {
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains" always;
location / {
proxy_pass http://abc-api_nginx;
proxy_pass http://dkhost.xai-corp.net:8084;
}
}

View File

@@ -12,12 +12,13 @@ dkhost03 ansible_ssh_host=192.168.2.53
cubox-i ansible_ssh_host=192.168.2.12
[dkhost]
dkhost01 ansible_ssh_host=192.168.2.41
#dkhost01 ansible_ssh_host=192.168.2.41
#dkhost02 ansible_ssh_host=192.168.2.43
dkhost03 ansible_ssh_host=192.168.2.53
#dkhost03 ansible_ssh_host=192.168.2.53
#dkhost04 ansible_ssh_host=192.168.2.54
#dkhost05 ansible_ssh_host=192.168.2.55
home ansible_ssh_host=192.168.2.11
#home ansible_ssh_host=192.168.2.11
localhost ansible_connection=local
[ns]
home02 ansible_ssh_host=192.168.2.22

View File

@@ -5,3 +5,5 @@ dockerhost:
users:
- richard
- ansible
# compose_version: 1.13.0
compose_version: 1.18.0

View File

@@ -0,0 +1,89 @@
---
# main tasks to install docker
- name: install packages
apt:
state: installed
package: "{{ item }}"
update_cache: yes
with_items:
- "htop"
- "wget"
- "apt-transport-https"
- "ca-certificates"
- "software-properties-common"
- "curl"
- "glusterfs-client"
- xfsprogs
- attr
- virtualbox-guest-additions-iso
- name: remove deprecated packages
apt:
state: absent
package: "{{ item }}"
with_items:
- "docker"
- "docker-engine"
- "docker.io"
- name: remove obsolete apt repro
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu ubuntu-xenial Release
state: absent
- name: install repo keys
shell: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- name: install apt repo
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
state: present
- name: install prerequisits
shell: apt-get -y install linux-image-extra-$(uname -r) linux-image-extra-virtual
- name: create docker group
group: state=present name=docker gid=999 system=yes
- name: add users to docker group
user: name={{ item }} groups=docker append=yes
with_items: "{{ dockerhost.users }}"
- name: install via apt
apt:
state: latest
update_cache: true
package: "{{ item }}"
with_items:
- docker-ce
# - virtualbox-guest-dkms
- name: copy docker config file
copy:
src: daemon.json
dest: /etc/docker/daemon.json
notify:
- restart docker
## install docker-compose
- name: install docker-compose from git repo
shell: |
curl -L https://github.com/docker/compose/releases/download/{{compose_version}}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
## expose the docker daemon on tcp
- name: expose docker daemon
file:
state: directory
path: /etc/systemd/system/docker.service.d
- name: expose docker daemon
copy:
src: docker.service.host.conf
dest: /etc/systemd/system/docker.service.d/host.conf
notify:
- restart docker

View File

@@ -1,7 +1,7 @@
---
# main docker tasks
- include: "install-xenial.yml"
- include: "install-xenial-ce.yml"
when: ansible_distribution_release == "xenial"
become: true

View File

@@ -2,13 +2,24 @@
#playbook to test items on localhost
- hosts: localhost
gather_facts: yes
become: true
# vars:
# java_packages:
# - openjdk-7-jdk
#
# roles:
vars:
docker:
init_config:
instances:
- url: "unix://var/run/docker.sock"
new_tag_names: true
dockerhost:
users:
- dd-agent
- richard
- ansible
roles:
- dockerhost
# - jenkins
# - devtools
# - {
@@ -18,26 +29,3 @@
# repo: "/home/richard/Documents/Aptana\ Studio\ 3/xai-corp\ workspace/htmlgames/"
# }
tasks:
- name: install apt repo
apt_repository:
repo: deb https://apt.dockerproject.org/repo ubuntu-xenial main
state: present
- name: import repo key
apt_key:
id: 58118E89F3A912897C070ADBF76221572C52609D
keyserver: "hkp://ha.pool.sks-keyservers.net:80"
state: present
- name: install prerequisits
shell: apt-get -y install linux-image-extra-$(uname -r) linux-image-extra-virtual
- name: install via apt
apt:
state: latest
update_cache: true
package: "{{ item }}"
with_items:
- docker-engine