---
- name: gem install sensu-plugins-etcd
  environment: proxy_env
  gem: name=sensu-plugins-etcd state=present user_install=no

- name: set permission to /etc/etcd for sensu
  file:
    path: /etc/etcd
    group: adm
    mode: g+rx

- name: set permissions to etcd cert for sensu checks
  file:
     path: "/etc/etcd/peer.{{ item }}"
     owner: etcd
     group: adm
     mode: 0640
  with_items:
    - key
    - crt

- name: add user sensu to group adm
  user:
    name: sensu
    groups: adm
    append: yes
  notify: restart sensu-client

---
- name: gem install sensu-plugins-etcd
  environment: proxy_env
  gem: name=sensu-plugins-etcd state=present user_install=no

- name: set permission to /etc/etcd for sensu
  file:
    path: /etc/etcd
    group: adm
    mode: g+rx
  when: dockerbuild is undefined

- name: set permissions to etcd cert for sensu checks
  file:
     path: "/etc/etcd/peer.{{ item }}"
     owner: etcd
     group: adm
     mode: 0640
  with_items:
    - key
    - crt
  when: dockerbuild is undefined

- name: add user sensu to group adm
  user:
    name: sensu
    groups: adm
    append: yes
  notify: restart sensu-client

Add dockerbuild is undefined in etcd check
Add dockerbuild is undefined in etcd check

  * We can't run cmd related to etcd directory durring the docker build. The directory and certs and on atomic host, not inside the docker container.
