ansible grafana


[root@localhost ~]# cat graf.yml
- hosts: all
  user: root
  become: yes
# the way to use priviledge
  become_method: sudo
  tasks:
   - name: install grafana rpm key
     rpm_key:
      key: https://packages.grafana.com/gpg.key
      state: present
     become: true

   - name: install grafana  rpm repository
     yum_repository:
       name: grafana
       description: grafana  packages
       baseurl: https://packages.grafana.com/oss/rpm
       gpgcheck: true
       gpgkey: https://packages.grafana.com/gpg.key
     become: true
   - name: install grafana
     yum:
       name: grafana
       state: present
     become: true
   - name: grafana is installed
     yum:
      name=grafana
      state=installed
   - name: grafana is running and enabled
     service:
      name=grafana-server
      state=started
      enabled=yes


root@localhost ~]# ansible-playbook graf.yml

PLAY [all] ****************************************************************************

TASK [Gathering Facts] ****************************************************************
ok: [192.168.1.7]

TASK [install grafana rpm key] ********************************************************
ok: [192.168.1.7]

TASK [install grafana  rpm repository] ************************************************
ok: [192.168.1.7]

TASK [install grafana] ****************************************************************
ok: [192.168.1.7]

TASK [grafana is installed] ***********************************************************
ok: [192.168.1.7]

TASK [grafana is running and enabled] *************************************************
ok: [192.168.1.7]

PLAY RECAP ****************************************************************************
192.168.1.7                : ok=6    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0 

[root@localhost ~]#
https://docs.google.com/document/d/e/2PACX-1vQHFzA5p6URCUUEjKsHzrOk_H2Oi8UXS16uHt1N8GUv-Ar2YV334J_mChFpfG3g500ikOQMGNHjxlyS/pub


Comments

Popular posts from this blog

ansible redhat cluster qorum qdevice

PE 3.9.0 on centos 6

gfs2 cluster