diff --git a/ansible/localhost/init.yaml b/ansible/localhost/init.yaml index 4a9ed80..6c47cb5 100644 --- a/ansible/localhost/init.yaml +++ b/ansible/localhost/init.yaml @@ -25,4 +25,53 @@ - exa state: latest update_cache: true - ignore_errors: yes \ No newline at end of file + ignore_errors: yes + + - name: Add Docker GPG apt Key + apt_key: + url: https://download.docker.com/linux/ubuntu/gpg + state: present + tags: docker + + - name: Add Docker Repository + apt_repository: + repo: deb https://download.docker.com/linux/ubuntu focal stable + state: present + tags: docker + + - name: Update apt and install docker-ce + apt: + name: docker-ce + state: latest + update_cache: true + tags: docker + + - name: Update ExecStart in Docker service file with exposing the port + lineinfile: + path: /lib/systemd/system/docker.service + regexp: '^ExecStart=' + line: 'ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375' + state: present + tags: docker, config + + - name: Reload systemd to apply changes + command: systemctl daemon-reload + tags: config + + - name: Start and enable Docker + service: + name: docker + state: started + enabled: yes + tags: docker + + - name: Create a login user + user: + name: "tylen" + password: "$6$OhH/TOtjPdxJgC9i$1ytWcV0yBuv5b4Momkka57tErCc4UqvG0zqydyyGQm3OXSaWPHTLHxvPjeCdA9B8T0./eXawj62xZ7gVtzokG/" + groups: + - docker + - sudo + state: present + shell: /usr/bin/zsh + tags: login