Skip to content
This repository has been archived by the owner on Mar 26, 2020. It is now read-only.

Commit

Permalink
nightly-container: Update image to better support envvars
Browse files Browse the repository at this point in the history
A systemd unit override is created for glusterd2.service to make systemd
passthrough required environment variables to the service.

Also, disable embedded etcd.
  • Loading branch information
kshlm committed Sep 18, 2018
1 parent edfd0b2 commit bf3c551
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion extras/nightly-container/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,37 @@
args:
warn: no

- name: Create override directory for glusterd2.service
file:
path: /etc/systemd/system/glusterd2.service.d
state: directory

# This makes systemd pass environment variables set for GD2 by kubernetes
- name: Enable PassEnvironment override for glusterd2.service
ini_file:
path: /etc/systemd/system/glusterd2.service.d/override.conf
section: Service
option: PassEnvironment
# PassEnvironment requires that each variable be mentioned individually
# More variables will need to be added here as required
value: GD2_ETCDENDPOINTS GD2_CLUSTER_ID GD2_RESTAUTH GD2_CLIENTADDRESS GD2_PEERADDRESS

- name: Create /etc/sysconfig/glusterd2/
file:
path: /etc/sysconfig/glusterd2
state: directory

- name: Disable embedded etcd for GD2
lineinfile:
path: /etc/sysconfig/glusterd2/noembed
create: yes
line: GD2_NOEMBED=true
state: present

# Using direct systemctl here as the way the service/systemd modules work
# requires dbus, which is not available in the container
- name: Enable glusterd2.service
command: systemctl enable glusterd2.service
args:
warn: no

## TODO: Customize GD2 config to use external etcd

0 comments on commit bf3c551

Please sign in to comment.