ansible: create .gitconfig for servo-backout-pr (
bug 1375739) r?gps
Git needs a configuration file in order to push to GitHub.
MozReview-Commit-ID: DOAZogdy3m1
--- a/ansible/roles/vcs-sync/tasks/servo-sync.yml
+++ b/ansible/roles/vcs-sync/tasks/servo-sync.yml
@@ -32,16 +32,22 @@
become_user: servo-sync
- name: ssh config for servo-sync user
template: src=servo-ssh_config.j2
dest=/home/servo-sync/.ssh/config
mode=0600
become_user: servo-sync
+- name: git config for servo-sync user
+ template: src=servo-git_config.j2
+ dest=/home/servo-sync/.gitconfig
+ mode=0600
+ become_user: servo-sync
+
- name: install SSH keys
copy: dest=/home/servo-sync/.ssh/id_{{ item.name }}
content="{{ item.value }}"
mode=0600
with_items:
- { name: github, value: "{{ servo_github_ssh_key }}" }
- { name: hgmo, value: "{{ servo_hgmo_ssh_key }}" }
become_user: servo-sync
new file mode 100644
--- /dev/null
+++ b/ansible/roles/vcs-sync/templates/servo-git_config.j2
@@ -0,0 +1,3 @@
+[user]
+ email = {{ servo_github_email | mandatory }}
+ name = {{ servo_github_name | mandatory }}
\ No newline at end of file
--- a/ansible/vcssync-deploy.yml
+++ b/ansible/vcssync-deploy.yml
@@ -20,16 +20,18 @@
# Ansible's variable interpolation behavior is crazy and this ugly redundancy
# parsing the YAML is the only way gps could get this to work.
- name: set fact with secrets
set_fact:
pulse_userid: "{{ (secrets.stdout | from_yaml).pulse_userid | mandatory }}"
pulse_password: "{{ (secrets.stdout | from_yaml).pulse_password | mandatory }}"
servo_github_token: "{{ (secrets.stdout | from_yaml).servo_github_token | mandatory }}"
+ servo_github_email: "{{ (secrets.stdout | from_yaml) .servo_github_email | mandatory }}"
+ servo_github_name: "{{ (secrets.stdout | from_yaml) .servo_github_name | mandatory }}"
servo_github_ssh_key: "{{ (secrets.stdout | from_yaml).servo_github_ssh_key | mandatory }}"
servo_hgmo_ssh_key: "{{ (secrets.stdout | from_yaml).servo_hgmo_ssh_key | mandatory }}"
servo_hgmo_ssh_user: "{{ (secrets.stdout | from_yaml).servo_hgmo_ssh_user | mandatory }}"
roles:
- common
- { role: journald-cloudwatch, journald_cloudwatch_group: /vcssync }
- vcs-sync