diff options
| author | Eugene Triguba <hello@eugenetriguba.com> | 2026-10-08 18:01:11 -0700 |
|---|---|---|
| committer | Eugene Triguba <hello@eugenetriguba.com> | 2026-10-11 18:36:51 -0700 |
| commit | 33bfce81f82fa1caf7d061485d257d7838534f19 (patch) | |
| tree | 0d11c71b3d80cff954f1f777a0e524b156eb16c8 /roles/obsd_git | |
| parent | Add public and private git repo dir setup (diff) | |
| download | site-configs-33bfce81f82fa1caf7d061485d257d7838534f19.zip | |
Resolve ansible-lint findings
Primarily, this is renaming variables to be prefixed with the role name.
Diffstat (limited to 'roles/obsd_git')
| -rw-r--r-- | roles/obsd_git/defaults/main.yml | 6 | ||||
| -rw-r--r-- | roles/obsd_git/tasks/main.yml | 54 | ||||
| -rw-r--r-- | roles/obsd_git/templates/git-shell-commands/create | 4 |
3 files changed, 32 insertions, 32 deletions
diff --git a/roles/obsd_git/defaults/main.yml b/roles/obsd_git/defaults/main.yml index d0ca79a..172f810 100644 --- a/roles/obsd_git/defaults/main.yml +++ b/roles/obsd_git/defaults/main.yml @@ -1,4 +1,4 @@ -git_user: git -git_home: /var/www/git -git_packages: +obsd_git_user: git +obsd_git_home: /var/www/git +obsd_git_packages: - git diff --git a/roles/obsd_git/tasks/main.yml b/roles/obsd_git/tasks/main.yml index 4d467d0..4d200f0 100644 --- a/roles/obsd_git/tasks/main.yml +++ b/roles/obsd_git/tasks/main.yml @@ -1,76 +1,76 @@ - name: Install git community.general.openbsd_pkg: - name: "{{ git_packages }}" + name: "{{ obsd_git_packages }}" state: present - name: Create git user ansible.builtin.user: - name: "{{ git_user }}" - home: "{{ git_home }}" + name: "{{ obsd_git_user }}" + home: "{{ obsd_git_home }}" create_home: false shell: /usr/local/bin/git-shell system: true - name: Create git home directory ansible.builtin.file: - path: "{{ git_home }}" + path: "{{ obsd_git_home }}" state: directory - owner: "{{ git_user }}" - group: "{{ git_user }}" + owner: "{{ obsd_git_user }}" + group: "{{ obsd_git_user }}" mode: "0755" - name: Create public git repository directory ansible.builtin.file: - path: "{{ git_home }}/public" + path: "{{ obsd_git_home }}/public" state: directory - owner: "{{ git_user }}" - group: "{{ git_user }}" + owner: "{{ obsd_git_user }}" + group: "{{ obsd_git_user }}" mode: "0755" - name: Create private git repository directory ansible.builtin.file: - path: "{{ git_home }}/private" + path: "{{ obsd_git_home }}/private" state: directory - owner: "{{ git_user }}" - group: "{{ git_user }}" + owner: "{{ obsd_git_user }}" + group: "{{ obsd_git_user }}" mode: "0700" - name: Silence message of the day for git user ansible.builtin.file: - path: "{{ git_home }}/.hushlogin" + path: "{{ obsd_git_home }}/.hushlogin" state: touch - owner: "{{ git_user }}" - group: "{{ git_user }}" + owner: "{{ obsd_git_user }}" + group: "{{ obsd_git_user }}" mode: "0644" - name: Create .ssh directory ansible.builtin.file: - path: "{{ git_home }}/.ssh" + path: "{{ obsd_git_home }}/.ssh" state: directory - owner: "{{ git_user }}" - group: "{{ git_user }}" + owner: "{{ obsd_git_user }}" + group: "{{ obsd_git_user }}" mode: "0700" - name: Deploy authorized_keys ansible.builtin.copy: content: "{{ git_authorized_keys | join('\n') }}\n" - dest: "{{ git_home }}/.ssh/authorized_keys" - owner: "{{ git_user }}" - group: "{{ git_user }}" + dest: "{{ obsd_git_home }}/.ssh/authorized_keys" + owner: "{{ obsd_git_user }}" + group: "{{ obsd_git_user }}" mode: "0600" - name: Create git-shell-commands directory ansible.builtin.file: - path: "{{ git_home }}/git-shell-commands" + path: "{{ obsd_git_home }}/git-shell-commands" state: directory - owner: "{{ git_user }}" - group: "{{ git_user }}" + owner: "{{ obsd_git_user }}" + group: "{{ obsd_git_user }}" mode: "0755" - name: Deploy git-shell create-repo helper script ansible.builtin.template: src: git-shell-commands/create - dest: "{{ git_home }}/git-shell-commands/create" - owner: "{{ git_user }}" - group: "{{ git_user }}" + dest: "{{ obsd_git_home }}/git-shell-commands/create" + owner: "{{ obsd_git_user }}" + group: "{{ obsd_git_user }}" mode: "0755" diff --git a/roles/obsd_git/templates/git-shell-commands/create b/roles/obsd_git/templates/git-shell-commands/create index 9ac25a5..53899eb 100644 --- a/roles/obsd_git/templates/git-shell-commands/create +++ b/roles/obsd_git/templates/git-shell-commands/create @@ -11,13 +11,13 @@ main() { repo_name=$(basename "$REPO" .git) if [ -n "$PROJ" ]; then - proj_dir="{{ git_home }}/$VISIBILITY/$PROJ" + proj_dir="{{ obsd_git_home }}/$VISIBILITY/$PROJ" if [ ! -d "$proj_dir" ]; then mkdir "$proj_dir" fi repo_path="$proj_dir/$repo_name.git" else - repo_path="{{ git_home }}/$VISIBILITY/$repo_name.git" + repo_path="{{ obsd_git_home }}/$VISIBILITY/$repo_name.git" fi if [ ! -d "$repo_path" ]; then |