diff options
author | Christian Franke <nobody@nowhere.ws> | 2015-10-26 20:38:25 +0100 |
---|---|---|
committer | Christian Franke <nobody@nowhere.ws> | 2015-10-26 20:38:25 +0100 |
commit | f38450f9f2037244300082f3e4211b790ac87058 (patch) | |
tree | 074ffa7d0512e099742641df8065d7b4139a6e99 /roles/repo_service/tasks | |
parent | 4e5034f57b54f1a5052fd859d3419002a477e628 (diff) |
- add hooks between webserver and gitserver:
git->website and wiki->git work now,
git->wiki is still missing,
https://ikiwiki.info/tips/Hosting_Ikiwiki_and_master_git_repository_on_different_machines/
should contain the right info for that
- actually configure repo_service
- replace LDAP auth with dummy password auth for now
Diffstat (limited to 'roles/repo_service/tasks')
-rw-r--r-- | roles/repo_service/tasks/as_repo_service.yaml | 40 | ||||
-rw-r--r-- | roles/repo_service/tasks/main.yaml | 13 |
2 files changed, 53 insertions, 0 deletions
diff --git a/roles/repo_service/tasks/as_repo_service.yaml b/roles/repo_service/tasks/as_repo_service.yaml index 6b364d8..b9a99ab 100644 --- a/roles/repo_service/tasks/as_repo_service.yaml +++ b/roles/repo_service/tasks/as_repo_service.yaml @@ -3,3 +3,43 @@ git: repo=https://github.com/cfra/repo_service.git dest=/var/lib/repo_service/src + notify: + - Restart repo_service + +- name: Create .ssh dir + file: + path="/var/lib/repo_service/.ssh" + state=directory + mode=0700 + +- name: Add repo_service ssh privkey + copy: + dest="/var/lib/repo_service/.ssh/id_rsa" + content="{{repo_service_privkey}}" + mode=0600 + +- name: Add repo_service ssh pubkey + copy: + dest="/var/lib/repo_service/.ssh/id_rsa.pub" + content="{{repo_service_pubkey}}" + mode=0644 + +- name: Read Gitserver Hostkey + slurp: src=/etc/ssh/ssh_host_ecdsa_key.pub + register: gitserver_host_key + +- name: Put Gitserver Hostkey into knownhosts + lineinfile: dest=/var/lib/repo_service/.ssh/known_hosts + create=yes + owner=repo_service + group=repo_service + mode=0644 + line="127.0.0.1 {{gitserver_host_key.content|b64decode}}" + +# Configure git +- name: Configure git push for repo service + command: git config --global push.default simple +- name: Configure git name + command: git config --global user.name "Repo Service {{ansible_hostname}}" +- name: + command: git config --global user.email "nobody@nowhere.ws" diff --git a/roles/repo_service/tasks/main.yaml b/roles/repo_service/tasks/main.yaml index b17319c..19139e0 100644 --- a/roles/repo_service/tasks/main.yaml +++ b/roles/repo_service/tasks/main.yaml @@ -12,3 +12,16 @@ become: yes become_user: repo_service become_method: su + +- name: Create systemd service + copy: + src=repo_service.service + dest=/etc/systemd/system/repo_service.service + notify: + - Reload systemd daemons + - Restart repo_service + +- name: Enable systemd service + service: + name: repo_service + enabled: yes |