-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chatbot: wip: fixes for docker-compose
- Loading branch information
Showing
22 changed files
with
196 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
--- | ||
|
||
pyper_telegram_token: '{{ vault_pyper_telegram_token }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
$ANSIBLE_VAULT;1.1;AES256 | ||
65366437396535653665313330633537643164363236326239633332396133616634656130613832 | ||
6434633336326666346262333566383263303463633163360a633137346632373166393430396137 | ||
39373461316438616334376464663966616132313866306331346535613330653433616336386463 | ||
3437356466333439370a643362306332636238343865333835363539363132303431343861613933 | ||
31313130323932313162633932363564303736333864303162373063613138623363373361363232 | ||
33663534653762663662353734393734393765356461383563376530663266343536383861313539 | ||
35396466363135616333343032626532396235656338306238356539393433373061363639626237 | ||
38623836613838653034613061366635366538326339376664613136363038663962363037333132 | ||
65336364623636643636316332636532646435666362653735303336303663303036 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
--- | ||
|
||
user: root | ||
user: "root" | ||
group: "{{ ansible_ssh_user }}" | ||
|
||
tmp_install_dir: | ||
bin_dir: | ||
install_dir: | ||
dockers_dir: "{{ install_dir }}/dockers" | ||
home_dir: '/home/{{ user }}' | ||
|
||
tmp_install_dir: '{{ home_dir }}/tmp' | ||
install_dir: '{{ home_dir }}/apps' | ||
bin_dir: '{{ home_dir }}/bin' | ||
|
||
config_dir_basename: "config" | ||
env_dir_basename: "envfile" | ||
|
||
dockers_files_dir: '{{ install_dir }}/dockerfile' | ||
dockers_volumes_dir: '{{ install_dir }}/volume' | ||
dockers_config_dir: '{{ install_dir }}/{{ config_dir_basename }}' | ||
dockers_env_dir: '{{ install_dir }}/{{ env_dir_basename }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
manager ansible_connection=local ansible_ssh_host=vagrant ansible_ssh_user=vagrant ansible_ssh_private_key_file=/vagrant/.vagrant/machines/manager/virtualbox/private_key | ||
manager ansible_ssh_user=vagrant ansible_ssh_private_key_file=/vagrant/.vagrant/machines/manager/virtualbox/private_key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
ansible==2.3.2 | ||
cryptography==2.0.3 | ||
ansible>=2.4.1 | ||
cryptography>=2.0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
--- | ||
|
||
chatbot_docker_path: "{{ dockers_dir }}/chatbot" | ||
|
||
dockerfile: 'Dockerfile' | ||
#dockerfile: 'Dockerfile.armhf' | ||
|
||
chatbot_docker_dir: '{{ dockers_dir }}/chatbot' | ||
chatbot_config_dir: '{{ config_dir }}/chatbot' | ||
chatbot_config_plugins_dir: '{{ chatbot_config_dir }}/plugins' | ||
chatbot_env_dir: '{{ env_dir }}/chatbot' | ||
chatbot_env_file_basename: 'chatbot_env' | ||
|
||
chatbot_dockerfiles_dir: '{{ dockers_files_dir }}/chatbot' | ||
chatbot_config_dir: '{{ dockers_config_dir }}/chatbot' | ||
chatbot_env_dir: '{{ dockers_env_dir }}/chatbot' |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
|
||
- name: chatbot restart | ||
docker_service: | ||
project_src: "{{ docker_compose_filepath }}" | ||
project_name: chatbot | ||
build: yes | ||
recreate: smart |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
|
||
- set_fact: | ||
chatbot_service: | | ||
chatbot: | ||
restart: always | ||
build: | ||
context: ./dockerfile/chatbot/ | ||
dockerfile: {{ dockerfile }} | ||
volumes: | ||
- chatbot_src:/usr/src/errbot/ | ||
- chatbot_data:/usr/src/errbot/data | ||
- ./{{ config_dir_basename }}/chatbot:/etc/errbot/:ro | ||
env_file: | ||
- ./{{ env_dir_basename }}/{{ chatbot_env_file_basename }} | ||
command: errbot | ||
chatbot_volumes: | | ||
chatbot_src: ~ | ||
chatbot_data: ~ | ||
- name: chatbot | Add services to docker-compose.yml | ||
blockinfile: | ||
dest: "{{ docker_compose_filepath }}" | ||
insertafter: "^services:$" | ||
marker: " # {mark} CHATBOT SERVICES - ANSIBLE MANAGED BLOCK #" | ||
block: "{{ chatbot_service | indent(2, true) }}" | ||
|
||
- name: chatbot | Add volumes to docker-compose.yml | ||
blockinfile: | ||
dest: "{{ docker_compose_filepath }}" | ||
insertafter: "^volumes:$" | ||
marker: " # {mark} CHATBOT VOLUMES - ANSIBLE MANAGED BLOCK #" | ||
block: "{{ chatbot_volumes | indent(2, true) }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
|
||
- name: chatbot | Copy err-rss plugin config files | ||
copy: | ||
src: 'config/plugins/err-rss/{{ item.src }}' | ||
dest: '{{ chatbot_config_plugins_dir }}/err-rss/{{ item.dest }}' | ||
with_items: | ||
- { src: 'err-rss-vault.ini', dest: 'err-rss.ini' } | ||
notify: chatbot restart | ||
|
||
- name: chatbot | Copy err-sponsors plugin config files | ||
copy: | ||
src: 'config/plugins/err-sponsors/{{ item.src }}' | ||
dest: '{{ chatbot_config_plugins_dir }}/err-sponsors/{{ item.dest }}' | ||
with_items: | ||
- { src: 'google_api_key.json', dest: 'google_api_key.json' } | ||
- { src: 'sponsor_agreement_template_eps-vault.tex', dest: 'sponsor_agreement_template_eps-vault.tex' } | ||
notify: chatbot restart | ||
|
||
# - name: chatbot | Copy err-gdrive plugin config files | ||
# copy: | ||
# src: 'config/plugins/err-gdrive/{{ item.src }}' | ||
# dest: '{{ chatbot_config_plugins_dir }}/err-gdrive/{{ item.dest }}' | ||
# with_items: | ||
# - { src: 'client_secrets.json', dest: 'client_secrets.json' } | ||
# - { src: 'pydrive_settings.yml', dest: 'pydrive_settings.yml' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
|
||
#python_docker_version: 2.5.1 | ||
python_docker_compose_version: 1.17.0rc1 | ||
|
||
docker_compose_filepath: "{{ install_dir }}/docker-compose.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: '2' | ||
|
||
services: | ||
|
||
|
||
volumes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,57 @@ | ||
--- | ||
|
||
- name: Install docker | ||
- name: docker-compose | Create folders for docker-compose | ||
file: | ||
path: '{{ item }}' | ||
state: directory | ||
owner: '{{ user }}' | ||
group: '{{ group }}' | ||
with_items: | ||
- '{{ dockers_files_dir }}' | ||
- '{{ dockers_volumes_dir }}' | ||
- '{{ dockers_config_dir }}' | ||
- '{{ dockers_env_dir }}' | ||
|
||
- name: docker-compose | Install docker | ||
shell: curl -sSL https://get.docker.com | sh | ||
|
||
- name: Install docker-compose and docker-py | ||
- name: docker-compose | Install docker-compose | ||
pip: | ||
name: '{{ item }}' | ||
state: forcereinstall | ||
with_items: | ||
- docker-py | ||
- docker-compose | ||
#- docker=={{ python_docker_version }} | ||
- docker-compose=={{ python_docker_compose_version }} | ||
|
||
- name: Add docker group | ||
- name: docker-compose | docker-compose.yml template file | ||
copy: | ||
src: docker-compose.yml | ||
dest: "{{ docker_compose_filepath }}" | ||
owner: "{{ user }}" | ||
group: "docker" | ||
mode: 0640 | ||
|
||
- name: docker-compose | Add docker group | ||
group: | ||
name: docker | ||
state: present | ||
|
||
- name: Add user to docker group | ||
- name: docker-compose | Add user to docker group | ||
user: | ||
name: "{{ user }}" | ||
groups: docker | ||
append: yes | ||
|
||
- name: docker-compose | Restart the docker daemon | ||
service: | ||
name: docker | ||
state: restarted | ||
|
||
- name: docker-compose | Change a few ownerships to root:docker | ||
file: | ||
path: '{{ item }}' | ||
owner: root | ||
group: docker | ||
with_items: | ||
- /var/run/docker.sock | ||
- /usr/bin/docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
--- | ||
|
||
- include: config.yml | ||
- import_tasks: config.yml | ||
tags: | ||
- config | ||
|
||
- include: known_hosts.yml | ||
- import_tasks: known_hosts.yml | ||
tags: | ||
- hosts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters