aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Dybiec <pawel@dybiec.info>2021-07-11 20:36:11 +0100
committerPaweł Dybiec <pawel@dybiec.info>2021-07-11 20:36:11 +0100
commita7bedbeaaad9a1ce8de9cc4dfc63b86c7c61fa30 (patch)
tree085cfe0b7f0d4ff3153733ff81a60799228f6cf2
parentMigration to a new server, moved nginx out of docker (diff)
Docker is dead, long live the podman
-rw-r--r--base_apps.yml20
-rw-r--r--compose/app/Dockerfile2
-rw-r--r--compose/cs/Dockerfile2
-rw-r--r--docker.yml95
4 files changed, 57 insertions, 62 deletions
diff --git a/base_apps.yml b/base_apps.yml
index 7acd2b5..7cc0c10 100644
--- a/base_apps.yml
+++ b/base_apps.yml
@@ -1,18 +1,11 @@
---
- name: Base
hosts: tamriel
- remote_user: ansible_worker
+ remote_user: root
become: yes
tasks:
- name: Ensure apt has https transport
apt: name=apt-transport-https
- - name: Docker gpg keys
- apt_key:
- url: https://download.docker.com/linux/debian/gpg
- - name: Docker deb repository
- apt_repository:
- repo: deb [arch=amd64] https://download.docker.com/linux/debian stretch stable
- update_cache: true
- name: Syncthing gpg keys
apt_key:
url: https://syncthing.net/release-key.txt
@@ -26,23 +19,18 @@
- tmux
- htop
- syncthing
- - docker-ce
- tig
- git
- rsync
- python3-pip
- mc
- mosh
+ - podman
+ force_apt_get: true
+ update_cache: true
- name: Upgrade all packages
apt:
upgrade: full
- - name: Install docker-compose
- pip:
- executable: pip3
- name:
- - docker
- - docker-compose
-
- name: Enable services
systemd:
enabled: true
diff --git a/compose/app/Dockerfile b/compose/app/Dockerfile
index 8db20e0..1780b6b 100644
--- a/compose/app/Dockerfile
+++ b/compose/app/Dockerfile
@@ -1,4 +1,4 @@
-FROM python:3.8-alpine
+FROM docker.io/python:3.8-alpine
ADD . /code
WORKDIR /code
RUN pip install -r requirements.txt
diff --git a/compose/cs/Dockerfile b/compose/cs/Dockerfile
index 57323dd..e03cc6d 100644
--- a/compose/cs/Dockerfile
+++ b/compose/cs/Dockerfile
@@ -1,4 +1,4 @@
-FROM python:3.7-alpine
+FROM docker.io/python:3.7-alpine
ADD . /code
WORKDIR /code
RUN pip install -r requirements.txt
diff --git a/docker.yml b/docker.yml
index 97d114e..7994895 100644
--- a/docker.yml
+++ b/docker.yml
@@ -9,14 +9,17 @@
- secrets.yml
tasks:
- name: Remove old config
+ tags: ["config"]
file:
path: "{{docker_compose_dir}}"
state: absent
- name: Synchronize docker-compose files
+ tags: ["config"]
synchronize:
src: compose/
dest: "{{docker_compose_dir}}"
- name: Copy main nginx.conf
+ tags: ["nginx"]
copy:
src: nginx/nginx.conf
dest: /etc/nginx/nginx.conf
@@ -24,6 +27,7 @@
owner: root
group: root
- name: Copy nginx site files
+ tags: ["nginx"]
copy:
src: nginx/conf.d/
dest: /etc/nginx/conf.d
@@ -31,6 +35,7 @@
owner: root
group: root
- name: Generate nginx conf
+ tags: ["nginx"]
template:
src: templates/nginx.conf.j2
dest: "/etc/nginx/conf.d/{{short_name}}.conf"
@@ -40,6 +45,7 @@
with_items: "{{domains | dict2items}}"
when: (item.value.disabled is undefined) or (item.value.disabled != true)
- name: Copy sites
+ tags: ["nginx"]
copy:
src: nginx/main/
dest: /var/www/html
@@ -47,6 +53,7 @@
owner: www-data
group: www-data
- name: Copy sites
+ tags: ["nginx"]
copy:
src: nginx/darling/
dest: /var/www/html/darling
@@ -54,51 +61,51 @@
owner: www-data
group: www-data
- name: reload nginx conf
+ tags: ["nginx"]
systemd:
name: nginx
state: reloaded
- - name: counter app
- docker_compose:
- project_name: app
- pull: yes
- build: yes
- definition:
- version: '3'
- services:
- web:
- build: "{{docker_compose_dir}}/app"
- ports:
- - "127.0.0.1:{{domains.cnt.proxy.port}}:5000"
- restart: always
- redis:
- image: "redis:alpine"
- restart: always
+ - name: counter pod
+ tags: ["podman", "counter"]
+ containers.podman.podman_pod:
+ name: "counter"
+ ports:
+ - "127.0.0.1:{{domains.cnt.proxy.port}}:5000"
+ - name: counter redis
+ tags: ["podman", "counter"]
+ containers.podman.podman_container:
+ name: redis
+ image: docker.io/redis:alpine
+ pod: "counter"
+ - name: counter image
+ tags: ["podman", "counter"]
+ containers.podman.podman_image:
+ name: dybiec.info/counter
+ path: "{{docker_compose_dir}}/app"
+ - name: counter
+ tags: ["podman", "counter"]
+ containers.podman.podman_container:
+ name: counter_app
+ image: dybiec.info/counter
+ pod: "counter"
+ - name: csgo image
+ tags: ["podman", "csgo"]
+ containers.podman.podman_image:
+ name: dybiec.info/csgo
+ path: "{{docker_compose_dir}}/cs/"
- name: csgo
- docker_compose:
- project_name: cs
- pull: yes
- build: yes
- definition:
- version: '3'
- services:
- web:
- build: "{{docker_compose_dir}}/cs"
- ports:
- - "127.0.0.1:{{domains.cs.proxy.port}}:5000"
- restart: always
- - name: vpn
- docker_compose:
- project_name: vpn
- pull: yes
- build: yes
- #state: absent
- definition:
- version: '3'
- services:
- openvpn:
- image: kylemanna/openvpn
- network_mode: host
- volumes:
- - "/root/openvpn:/etc/openvpn"
- privileged: true
- restart: always
+ tags: ["podman", "csgo"]
+ containers.podman.podman_container:
+ name: cs
+ image: dybiec.info/csgo
+ ports:
+ - "127.0.0.1:{{domains.cs.proxy.port}}:5000"
+ - name: openvpn
+ tags: ["podman", "openvpn"]
+ containers.podman.podman_container:
+ name: openvpn
+ image: docker.io/kylemanna/openvpn
+ network: host
+ volume:
+ - "/root/openvpn:/etc/openvpn"
+ privileged: true