ansible/bootstrap: set hostname based on hostgroup variable during bootstrap
authorConnor Sheehan <sheehan@mozilla.com>
Mon, 13 May 2019 13:15:02 -0400
changeset 7014 91edbf180dfbbcf5e8b1fc0cb9886658d49452cd
parent 7013 c5cdceaf4de3604803cf180f6949e1b8a78457a3
child 7015 e3dce3f0d26a812bebc2ed00f37457d1e4b18e60
push id3491
push usercosheehan@mozilla.com
push dateMon, 13 May 2019 17:36:05 +0000
treeherderversion-control-tools@91edbf180dfb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
ansible/bootstrap: set hostname based on hostgroup variable during bootstrap
ansible/bootstrap-hgweb.yml
--- a/ansible/bootstrap-hgweb.yml
+++ b/ansible/bootstrap-hgweb.yml
@@ -26,16 +26,23 @@
       command: /var/hg/venv_tools/bin/vcsreplicator-bootstrap-hgssh /etc/mercurial/hgrc /var/hg/venv_pash/bin/hg --workers {{ hgssh_workers | default(5) }} --output /home/hg/hgssh.json
       become_user: hg
 
     - name: get hgssh bootstrap object
       slurp: src=/home/hg/hgssh.json
       become_user: hg
       register: hgsshjson
 
+- hosts: bootstrap
+  become: true
+  tasks:
+    - name: set hostname
+      hostname:
+        name: "{{ bootstrap_hostname }}"
+
 - name: bootstrap an hgweb instance
   import_playbook: deploy-hgweb.yml
   vars:
     var_hostgroup: bootstrap
   when: instance == 'hgweb'
 
 - name: bootstrap an hgweb mirror
   import_playbook: deploy-mirrors.yml