Merge lp:~wesmason/charms/trusty/conn-check/trunk-fix-perms into lp:~ubuntuone-hackers/charms/trusty/conn-check/trunk

Proposed by Wes Mason
Status: Merged
Approved by: Wes Mason
Approved revision: 36
Merged at revision: 36
Proposed branch: lp:~wesmason/charms/trusty/conn-check/trunk-fix-perms
Merge into: lp:~ubuntuone-hackers/charms/trusty/conn-check/trunk
Diff against target: 44 lines (+8/-4)
1 file modified
playbook.yaml (+8/-4)
To merge this branch: bzr merge lp:~wesmason/charms/trusty/conn-check/trunk-fix-perms
Reviewer Review Type Date Requested Status
Michael Nelson (community) Approve
Review via email: mp+259102@code.launchpad.net

Commit message

Ensure config file, if written by charm, is set to the right user/group

Description of the change

Ensure we set the correct user/group on the config file if the charm writes it (rather than being set by config_path).

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

20:48 < noodles> wes: I still don't understand why you don't just do nagios:nagios for those perms?
20:49 < noodles> Why do the "run check" and "run nagios checks" tasks need a separate user?
20:50 < wes> noodles: I don't think they do, although I am uneasy about creating/updating the user in the conn-check charm which may be created/updated differently in the nrpe charm
20:51 -!- noise [<email address hidden>] has quit [Ping timeout: 121 seconds]
20:52 < noodles> wes: why would you create/update the user?
20:52 < noodles> Don't those tasks specifically run after the nagios user will already be created?
20:53 < wes> noodles: nope, as it's not guaranteed you're using nagios with the charm
20:54 < noodles> OK, makes sense.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'playbook.yaml'
2--- playbook.yaml 2015-05-12 09:08:14 +0000
3+++ playbook.yaml 2015-05-14 11:01:21 +0000
4@@ -11,6 +11,8 @@
5 wheels_url: http://bazaar.launchpad.net/~ubuntuone-hackers/conn-check/wheels
6 current_dir: "{{ env_dir }}/{{ revision }}"
7 bin_path: "{{ current_dir }}/bin/conn-check"
8+ user: conn-check
9+ group: nagios
10
11 tasks:
12
13@@ -65,6 +67,8 @@
14 copy:
15 content: "{{ relations['conn-check'][0]['config'] }}"
16 dest: "{{ config_path }}"
17+ owner: "{{ user }}"
18+ group: "{{ group }}"
19 mode: 0600
20 when: not (path_provided | bool) and (config_provided | bool)
21
22@@ -99,18 +103,18 @@
23 tags:
24 - install
25 - upgrade-charm
26- group: name=conn-check system=yes
27+ group: "name={{ group }} system=yes"
28
29 - name: create user
30 tags:
31 - install
32 - upgrade-charm
33- user: name=conn-check group=conn-check createhome=no system=yes
34+ user: "name={{ user }} group={{ group }} createhome=no system=yes"
35
36 - name: run check
37 tags: run-check
38- shell: "sudo -u conn-check {{ bin_path }} {{ args }} {{ config_path }}"
39+ shell: "sudo -u {{ user }} {{ bin_path }} {{ args }} {{ config_path }}"
40
41 - name: run nagios checks
42 tags: run-nagios-check
43- shell: "sudo -u conn-check {{ bin_path }} --exclude-tags=no-nagios {{ args }} {{ config_path }}"
44+ shell: "sudo -u {{ user }} {{ bin_path }} --exclude-tags=no-nagios {{ args }} {{ config_path }}"

Subscribers

People subscribed via source and target branches

to all changes: