diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fc4bacb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM ubuntu:20.04 as base +ENV ANSIBLE_VERSION 2.9.17 +RUN apt-get update; \ + apt-get install -y gcc python3 sshpass; \ + apt-get install -y python3-pip; \ + apt-get clean all +RUN pip3 install --upgrade pip; \ + pip3 install "ansible==${ANSIBLE_VERSION}"; \ + pip3 install ansible; + +FROM base as update + +WORKDIR /ansible + +COPY . . \ No newline at end of file diff --git a/ansible.cfg b/ansible.cfg index 9a77c7a..913733a 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -3,6 +3,7 @@ nocows = True roles_path = ./roles inventory = ./inventory/my-cluster/hosts.ini stdout_callback = yaml +interpreter_python = auto_silent remote_tmp = $HOME/.ansible/tmp local_tmp = $HOME/.ansible/tmp @@ -21,3 +22,4 @@ retries = 3 ssh_args = -o ControlMaster=auto -o ControlPersist=30m -o Compression=yes -o ServerAliveInterval=15s pipelining = True control_path = %(directory)s/%%h-%%r +host_key_checking = False diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index 5fa1b30..0000000 --- a/deploy.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -ansible-playbook site.yml -i inventory/my-cluster/hosts.ini \ No newline at end of file diff --git a/scripts/deploy.sh b/scripts/deploy.sh new file mode 100755 index 0000000..808cdb3 --- /dev/null +++ b/scripts/deploy.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +ansible-playbook site.yml -i inventory/my-cluster/hosts.ini diff --git a/reboot.sh b/scripts/reboot.sh similarity index 100% rename from reboot.sh rename to scripts/reboot.sh diff --git a/reset.sh b/scripts/reset.sh similarity index 100% rename from reset.sh rename to scripts/reset.sh diff --git a/scripts/update.sh b/scripts/update.sh new file mode 100755 index 0000000..a81481b --- /dev/null +++ b/scripts/update.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +ansible-playbook playbook-lxc-update.yml -i inventory/my-cluster/hosts.ini --ask-vault-pass