You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
596 B

  1. ---
  2. - name: Create the base repo directory
  3. file:
  4. path: /var/lib/tildes-wiki
  5. state: directory
  6. owner: "{{ app_username }}"
  7. group: "{{ app_username }}"
  8. mode: 0775
  9. - name: Check if a wiki git repo exists
  10. stat:
  11. path: /var/lib/tildes-wiki/.git
  12. register: wiki_repo
  13. - name: Create a git repo and initial commit
  14. become_user: "{{ app_username }}"
  15. shell:
  16. cmd: |
  17. git init
  18. git config user.name "Tildes"
  19. git config user.email "Tildes"
  20. git commit --allow-empty -m "Initial commit"
  21. chdir: /var/lib/tildes-wiki
  22. when: not wiki_repo.stat.exists