From e0187a235c761240dacb8fd765f9eab9d4e8404c Mon Sep 17 00:00:00 2001 From: Nikolaos Boutalas Date: Mon, 7 Aug 2023 10:45:42 +0300 Subject: Initialize project and introduce Dockerfile I added a simple Dockerfile that builds an Ubuntu based container ready to be used with Ansible. --- .dockerignore | 1 + Dockerfile | 19 +++++++++++++++++++ README.md | 13 +++++++++++++ local.yml | 0 setup.sh | 3 +++ 5 files changed, 36 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 local.yml create mode 100755 setup.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..2d2ecd6 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.git/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2668fad --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu:latest + +RUN apt-get update && \ + apt-get install -y ansible python3-apt + +RUN apt-get install -y sudo \ + && useradd -m -s /bin/bash admin \ + && echo "admin ALL=(ALL) ALL" >> /etc/sudoers \ + && passwd -d root + +RUN echo 'admin:admin' | chpasswd + +USER admin +WORKDIR /home/admin + +COPY --chown=admin . init +WORKDIR init + +CMD ["/bin/bash"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..935b160 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# init + +## Development + +In order to test this, you can use *Docker* and build a simple Ubuntu container + +```bash + git clone git@github.com:nikolaosboutalas/init.git + cd init + docker build . -t ansible && docker run --rm -it ansible + # Inside the new running container + ./setup.sh +``` diff --git a/local.yml b/local.yml new file mode 100644 index 0000000..e69de29 diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..f5e94a3 --- /dev/null +++ b/setup.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +ansible-playbook local.yml --ask-become-pass --ask-vault-pass -- cgit v1.2.3