From a8166ab9075f7720af3e68a7d2493c1ba0df3ba4 Mon Sep 17 00:00:00 2001 From: David Rotermund <54365609+davrot@users.noreply.github.com> Date: Fri, 29 Mar 2024 20:39:15 +0100 Subject: [PATCH] Add files via upload --- README.md | 2 +- install_docker.yaml | 23 ++-------------------- install_docker_web.yaml | 31 ++++++++++++++++++++++++++++++ install_semaphore.yaml | 42 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+), 22 deletions(-) create mode 100644 install_docker_web.yaml create mode 100644 install_semaphore.yaml diff --git a/README.md b/README.md index 534aa81..80e729a 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ dnf -y install ansible mc net-tools openssh-server openssh-clients passwdqc crac systemctl enable sshd systemctl start sshd -useradd -b /specialusers/ ansibleuser +useradd -b /specialusers ansibleuser passwd_value="PUT_A_PASSWORD_HERE" echo ansibleuser:$passwd_value | chpasswd echo "ansibleuser ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/ansible diff --git a/install_docker.yaml b/install_docker.yaml index 09016b2..89c6ff1 100644 --- a/install_docker.yaml +++ b/install_docker.yaml @@ -1,29 +1,10 @@ --- -- name: install docker as servie +- name: install docker as systemd plus add a portainer agent hosts: all become: true tasks: - name: remove other files - include_tasks: yaml_sub/myrepo_clean.yaml - - - name: update file myrepo.repo - import_tasks: yaml_sub/myrepo_data.yaml - - - name: install docker rpm - dnf: - name: "docker-ce,docker-ce-cli,docker-ce-rootless-extras,docker-buildx-plugin,docker-compose-plugin,python3,python3-pip,python3-requests" - state: latest - update_cache: true - skip_broken: true - nobest: false - allowerasing: true - enablerepo: "docker-ce-stable" - - - name: make sure docker service unit is started - systemd_service: - state: started - name: docker - enabled: true + include_tasks: yaml_sub/install_docker.yaml diff --git a/install_docker_web.yaml b/install_docker_web.yaml new file mode 100644 index 0000000..a45c4de --- /dev/null +++ b/install_docker_web.yaml @@ -0,0 +1,31 @@ +--- +- name: install docker as systemd plus add a protainer web + hosts: all + become: true + + tasks: + + - name: remove other files + include_tasks: yaml_sub/install_docker.yaml + + - name: Create a volume + community.docker.docker_volume: + name: portainer_data + state: present + + - name: Create portainer container + community.docker.docker_container: + name: portainerweb + image: portainer/portainer-ce + state: started + recreate: yes + restart_policy: always + published_ports: + - "8000:8000/tcp" + - "9443:9443/tcp" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - portainer_data:/data + + + diff --git a/install_semaphore.yaml b/install_semaphore.yaml new file mode 100644 index 0000000..2ed5fce --- /dev/null +++ b/install_semaphore.yaml @@ -0,0 +1,42 @@ +--- +- name: install ansible semaphore + hosts: all + become: true + + tasks: + + - name: remove other files + include_tasks: yaml_sub/install_docker.yaml + + - name: Create volume semaphore_etc + community.docker.docker_volume: + name: semaphore_etc + state: present + + - name: Create volume semaphore_lib + community.docker.docker_volume: + name: semaphore_lib + state: present + + - name: Create portainer container + community.docker.docker_container: + name: semaphore + image: semaphoreui/semaphore + state: started + recreate: yes + restart_policy: always + published_ports: + - "3000:3000/tcp" + volumes: +# - /var/run/docker.sock:/var/run/docker.sock + - semaphore_etc:/etc/semaphore + - semaphore_lib:/var/lib/semaphore + env: + SEMAPHORE_DB_DIALECT: bolt + SEMAPHORE_ADMIN_PASSWORD: changeme + SEMAPHORE_ADMIN_NAME: admin + SEMAPHORE_ADMIN_EMAIL: davrot@uni-bremen.de + SEMAPHORE_ADMIN: admin + TZ: Europe/Berlin + +