From af023c0487e4887dca2df68e2b09fee2ff0d6f4b Mon Sep 17 00:00:00 2001 From: Marius Alwan Meyer <22202402+sporqist@users.noreply.github.com> Date: Fri, 28 Apr 2023 22:30:47 +0000 Subject: [PATCH 1/2] make ansible-lint happy --- tasks/main.yaml | 35 ++++++++++++++++++----------------- vars/main.yaml | 2 +- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/tasks/main.yaml b/tasks/main.yaml index b7d457e..ff83533 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -1,11 +1,10 @@ ---- -#- name: Install Dependencies -# apt: -# pkg: -# - apparmor -# - docker.io -# - python3-docker +# - name: Install Dependencies +# apt: +# pkg: +# - apparmor +# - docker.io +# - python3-docker - name: Create git USER ansible.builtin.user: @@ -13,32 +12,32 @@ register: git_user - name: Create Gitea - file: + ansible.builtin.file: path: "/opt/gitea" state: directory owner: root - mode: 0755 + mode: "755" - name: Create Data Directory - file: + ansible.builtin.file: path: "/opt/gitea/data" state: directory owner: "{{ git_user.uid }}" group: "{{ git_user.group }}" - mode: 0700 + mode: "700" - name: Create Config Directory - file: + ansible.builtin.file: path: "/opt/gitea/config" state: directory owner: "{{ git_user.uid }}" group: "{{ git_user.group }}" - mode: 0700 + mode: "700" - name: Start Docker Daemon - systemd: + ansible.builtin.systemd: name: docker - enabled: yes + enabled: true state: started - name: Backup Files @@ -53,6 +52,7 @@ ansible.builtin.copy: src: /opt/gitea dest: "/opt/gitea.backup@{{ ansible_date_time.iso8601 }}" + mode: "700" remote_src: true directory_mode: true register: backup @@ -64,7 +64,7 @@ src: environment.env.j2 dest: "/opt/gitea/environment.env" owner: root - mode: 0600 + mode: "600" register: gitea_env - name: Upload docker-compose.yaml @@ -72,7 +72,7 @@ src: docker-compose.yaml.j2 dest: /opt/gitea/docker-compose.yaml owner: root - mode: 0600 + mode: "600" register: gitea_container - name: Create / Recreate Gitea @@ -102,6 +102,7 @@ src: "{{ backup.dest }}" dest: "{{ backup.src }}" remote_src: true + mode: "700" - name: Create / Recreate Gitea community.docker.docker_compose: diff --git a/vars/main.yaml b/vars/main.yaml index e05e69e..b210bd8 100644 --- a/vars/main.yaml +++ b/vars/main.yaml @@ -1,7 +1,7 @@ gitea_defaults: gitea_vars: | {%- if gitea is defined and gitea is iterable -%} - {{ gitea_defaults | combine (gitea, recursive=True) }} + {{ gitea_defaults | combine(gitea, recursive=True) }} {%- else -%} {{ gitea }} {%- endif -%} From d8e817c969db3f9c9829f0b3e3aebd6d92c35c13 Mon Sep 17 00:00:00 2001 From: Marius Alwan Meyer <22202402+sporqist@users.noreply.github.com> Date: Fri, 28 Apr 2023 22:52:40 +0000 Subject: [PATCH 2/2] put ansible-lint in it's place --- .ansible-lint-ignore | 6 ++++++ tasks/main.yaml | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .ansible-lint-ignore diff --git a/.ansible-lint-ignore b/.ansible-lint-ignore new file mode 100644 index 0000000..da7d420 --- /dev/null +++ b/.ansible-lint-ignore @@ -0,0 +1,6 @@ + +# In den hier aufgelisteten Dateien sollen die dahinter stehenden +# Warnungen und Fehler von ansible-lint ignoriert werden. + +tasks/main.yaml no-handler # Der Restart / Recreate Gitea Task ist gut dort, wo er ist +tasks/main.yaml name[template] # Es braucht zwei Templates, um den FQDN zusammenzusetzen. diff --git a/tasks/main.yaml b/tasks/main.yaml index ff83533..261514c 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -1,4 +1,3 @@ - # - name: Install Dependencies # apt: # pkg: