DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (2f7b4df4a928)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
---
- hosts: hgssh-prod
  tasks:
  # Until we integrate secrets with Ansible, the LDAP config is
  # pre-defined on the server.
  - name: capture LDAP config
    slurp: src=/etc/mercurial/ldap.json
    register: ldap_config

  # Ditto for the Pulse config.
  - name: capture Pulse config
    slurp: src=/etc/mercurial/pulse.json
    register: pulse_config

  - name: capture aws events config
    slurp: src=/etc/mercurial/awsevents.json
    register: awsevents_config

  - name: apply hg-ssh role
    include_role:
      name: hg-ssh
    vars:
      bind_dn: "{{ (ldap_config.content | b64decode | from_json).username }}"
      bind_pw: "{{ (ldap_config.content | b64decode | from_json).password }}"
      ldap_uri: "{{ (ldap_config.content | b64decode | from_json).url }}"
      ldap_starttls: "{{ (ldap_config.content | b64decode | from_json).starttls | default(True) }}"
      hgweb_hosts: "{{ groups['hgweb-prod'] }}"
      pulse_user: "{{ (pulse_config.content | b64decode | from_json).user }}"
      pulse_password: "{{ (pulse_config.content | b64decode | from_json).password }}"
      awsevents_access_key_id: "{{ (awsevents_config.content | b64decode | from_json).access_key_id }}"
      awsevents_secret_access_key: "{{ (awsevents_config.content | b64decode | from_json).secret_access_key }}"

  - name: apply monitoring-agent role
    include_role:
      name: monitoring-agent
    vars:
      hosttype: hgssh

  - name: discover kafka topics
    command: /opt/kafka/bin/kafka-topics.sh --zookeeper {{ kafka_zookeeper_connect }} --list
    register: kafka_topics
    when: ansible_hostname == 'hgssh1'

  - name: create kafka topics
    command: /opt/kafka/bin/kafka-topics.sh --zookeeper {{ kafka_zookeeper_connect }} --create --topic {{ item.topic }} --partitions {{ item.partitions }} --replication-factor {{ kafka_replication_factor }} --config min.insync.replicas={{ kafka_min_insync_replicas }} --config unclean.leader.election.enable=false --config max.message.bytes=104857600
    when: ansible_hostname == 'hgssh1' and item.topic not in kafka_topics.stdout_lines
    with_items:
      - { topic: pushdata, partitions: 8 }
      - { topic: pushlog, partitions: 1 }
      # copy of messages from "pushdata" once they are acknowledged by mirrors
      - { topic: replicatedpushdatapending, partitions: 1 }
      - { topic: replicatedpushdata, partitions: 1 }

  - name: record deployment of this changeset
    copy: dest=/etc/mercurial/deployed_vct_changeset
          content={{ lookup('file', '../.vctnode') }}
          owner=root
          group=root
          mode=0644
    when: ansible_hostname == 'hgssh1'