- name: Stage Kottos release tarball hosts: localhost gather_facts: false vars: archive_path: "{{rel_dir}}/kottos_{{kottos_rel}}.tar" kottos_repo_url: "ssh://git@git.helu.ca:22022/r/kottos.git" kottos_repo_dir: "{{repo_dir}}/kottos" tasks: - name: Ensure release directory exists file: path: "{{rel_dir}}" state: directory mode: '755' - name: Ensure repo directory exists file: path: "{{repo_dir}}" state: directory mode: '755' - name: Clone Kottos repository if not present ansible.builtin.git: repo: "{{kottos_repo_url}}" dest: "{{kottos_repo_dir}}" version: "{{kottos_rel}}" accept_hostkey: true register: git_clone ignore_errors: true - name: Fetch latest changes if already cloned ansible.builtin.git: repo: "{{kottos_repo_url}}" dest: "{{kottos_repo_dir}}" version: "{{kottos_rel}}" update: true force: true - name: Create release archive ansible.builtin.archive: path: "{{kottos_repo_dir}}" dest: "{{archive_path}}" format: tar exclude_path: - "{{kottos_repo_dir}}/.git" - "{{kottos_repo_dir}}/.venv" - "{{kottos_repo_dir}}/__pycache__" - "{{kottos_repo_dir}}/fastagent.secrets.yaml"