285f884691
The code is switching from relying on metadata based groups to dynamically created groups with add_host. As such, the group containing puppetmaster is now 'puppetmaster'. Change-Id: Ic66a68fd7e873816ec27be37ce4842eea8268a47
24 lines
735 B
YAML
24 lines
735 B
YAML
---
|
|
- name: Fetch Gerrit MySQL password from Puppetmaster hiera
|
|
command: hiera -c /etc/puppet/hiera.yaml gerrit_mysql_password environment=production
|
|
delegate_to: "{{ groups['puppetmaster'][0] }}"
|
|
register: gerrit_mysql_password
|
|
no_log: True
|
|
|
|
- name: Install Gerrit required packages
|
|
apt: name={{ item }} state=installed
|
|
with_items:
|
|
- mysql-server
|
|
- python-mysqldb
|
|
- haveged
|
|
|
|
- name: Create Gerrit database
|
|
mysql_db: name=reviewdb state=present
|
|
|
|
- name: Start and enable MySQL service
|
|
service: name=mysql state=running enabled=yes
|
|
|
|
- name: Create Gerrit MySQL user and grant privileges
|
|
mysql_user: user=gerrit2 password="{{ gerrit_mysql_password.stdout }}" priv=*.*:ALL,GRANT state=present
|
|
no_log: True
|