update docker and postgres installs
This commit is contained in:
@@ -11,6 +11,7 @@ services:
|
|||||||
POSTGRES_PASSWORD: snqioxni1sw
|
POSTGRES_PASSWORD: snqioxni1sw
|
||||||
POSTGRES_USER: xaicorp_admin
|
POSTGRES_USER: xaicorp_admin
|
||||||
POSTGRES_DB: xaicorp_default
|
POSTGRES_DB: xaicorp_default
|
||||||
|
PGDATA: /data/xaicorp_pgdata
|
||||||
ports:
|
ports:
|
||||||
- 5432:5432
|
- 5432:5432
|
||||||
|
|
||||||
|
|||||||
@@ -21,13 +21,13 @@ services:
|
|||||||
# syslog-address: "tcp+tls://logs6.papertrailapp.com:38577"
|
# syslog-address: "tcp+tls://logs6.papertrailapp.com:38577"
|
||||||
# tag: "{{.Name}}/{{.ID}}"
|
# tag: "{{.Name}}/{{.ID}}"
|
||||||
|
|
||||||
logging:
|
# logging:
|
||||||
driver: fluentd
|
# driver: fluentd# tag: sslproxy
|
||||||
options:
|
|
||||||
fluentd-address: "logs.xai-corp.net:24224"
|
|
||||||
fluentd-async-connect: 'true'
|
|
||||||
tag: sslproxy
|
|
||||||
|
|
||||||
|
|
||||||
|
# options:
|
||||||
|
# fluentd-address: "logs.xai-corp.net:24224"
|
||||||
|
# fluentd-async-connect: 'true'
|
||||||
# logging:
|
# logging:
|
||||||
# driver: syslog
|
# driver: syslog
|
||||||
# options:
|
# options:
|
||||||
@@ -54,7 +54,7 @@ services:
|
|||||||
|
|
||||||
networks:
|
networks:
|
||||||
- ingress
|
- ingress
|
||||||
- prod-private
|
# - prod-private
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
ingress:
|
ingress:
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ server {
|
|||||||
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains" always;
|
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains" always;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://abc-api_nginx;
|
proxy_pass http://dkhost.xai-corp.net:8084;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,12 +12,13 @@ dkhost03 ansible_ssh_host=192.168.2.53
|
|||||||
cubox-i ansible_ssh_host=192.168.2.12
|
cubox-i ansible_ssh_host=192.168.2.12
|
||||||
|
|
||||||
[dkhost]
|
[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
|
#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
|
#dkhost04 ansible_ssh_host=192.168.2.54
|
||||||
#dkhost05 ansible_ssh_host=192.168.2.55
|
#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]
|
[ns]
|
||||||
home02 ansible_ssh_host=192.168.2.22
|
home02 ansible_ssh_host=192.168.2.22
|
||||||
|
|||||||
@@ -5,3 +5,5 @@ dockerhost:
|
|||||||
users:
|
users:
|
||||||
- richard
|
- richard
|
||||||
- ansible
|
- ansible
|
||||||
|
# compose_version: 1.13.0
|
||||||
|
compose_version: 1.18.0
|
||||||
|
|||||||
89
roles/dockerhost/tasks/install-xenial-ce.yml
Normal file
89
roles/dockerhost/tasks/install-xenial-ce.yml
Normal 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
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
# main docker tasks
|
# main docker tasks
|
||||||
|
|
||||||
- include: "install-xenial.yml"
|
- include: "install-xenial-ce.yml"
|
||||||
when: ansible_distribution_release == "xenial"
|
when: ansible_distribution_release == "xenial"
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
|
|||||||
@@ -2,13 +2,24 @@
|
|||||||
#playbook to test items on localhost
|
#playbook to test items on localhost
|
||||||
|
|
||||||
- hosts: localhost
|
- hosts: localhost
|
||||||
|
gather_facts: yes
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
# vars:
|
vars:
|
||||||
# java_packages:
|
docker:
|
||||||
# - openjdk-7-jdk
|
init_config:
|
||||||
#
|
instances:
|
||||||
# roles:
|
- url: "unix://var/run/docker.sock"
|
||||||
|
new_tag_names: true
|
||||||
|
|
||||||
|
dockerhost:
|
||||||
|
users:
|
||||||
|
- dd-agent
|
||||||
|
- richard
|
||||||
|
- ansible
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- dockerhost
|
||||||
# - jenkins
|
# - jenkins
|
||||||
# - devtools
|
# - devtools
|
||||||
# - {
|
# - {
|
||||||
@@ -18,26 +29,3 @@
|
|||||||
# repo: "/home/richard/Documents/Aptana\ Studio\ 3/xai-corp\ workspace/htmlgames/"
|
# 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
|
|
||||||
|
|||||||
Reference in New Issue
Block a user