Skip to content

Commit

Permalink
ansible-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Onur committed May 6, 2019
1 parent c93c3b3 commit 97c50c7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 2 additions & 0 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
name: firewalld
state: stopped
enabled: no
become: yes
become_method: sudo

- name: Create base directories
file: path="{{ item }}" state=directory mode=0777 owner="0" group="0"
Expand Down
4 changes: 2 additions & 2 deletions roles/gitea/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@

- name: sync docker-compose.yml
template:
src: ../templates/docker-compose.yml.j2
src: docker-compose.yml.j2
dest: /tmp/{{ gitea_service_name }}/docker-compose.yml
mode: 0755
become: yes
become_method: sudo

- name: sync app.ini
template:
src: ../templates/app.ini.j2
src: app.ini.j2
dest: "{{ docker_volumes }}/{{ gitea_service_name }}/data/gitea/conf/app.ini"
mode: 0644
owner: "{{ gitea_user }}"
Expand Down
18 changes: 10 additions & 8 deletions roles/grafana/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
dest: '{{ docker_volumes }}/{{ prometheus_service_name }}/config/prometheus.yml'
owner: '{{ prometheus_user }}'
group: '{{ prometheus_group }}'
when: prometheus_config_file.stat.exists == False
when: not prometheus_config_file.stat.exists
become: yes
become_method: sudo

Expand All @@ -44,7 +44,7 @@
repo: "{{ grafana_provisioning_repo_url }}"
dest: "{{ docker_volumes }}/{{ grafana_service_name }}/provisioning"
version: "{{ grafana_provisioning_repo_branch }}"
when: grafana_dashboard_config_file.stat.exists == False
when: not grafana_dashboard_config_file.stat.exists
become: yes
become_method: sudo

Expand Down Expand Up @@ -76,8 +76,8 @@
grafana_admin_pass: "{{ lookup('password', '../credentials/grafana_admin_pass chars=ascii_letters,digits,hexdigits length=12') }}"

- name: sync docker-compose.yml
template:
src: ../templates/docker-compose.yml.j2
template:
src: docker-compose.yml.j2
dest: /tmp/{{ grafana_service_name }}/docker-compose.yml
mode: 0755
become: yes
Expand All @@ -91,13 +91,15 @@
project_src: "/tmp/{{ grafana_service_name }}"
register: output

- set_fact: container_name="{{ vars['output']['ansible_facts']['prometheus'].keys()[0] }}"
- name: get grafana container name
set_fact: container_name="{{ vars['output']['ansible_facts']['prometheus'].keys()[0] }}"

- set_fact: run_inside_container="docker exec -i {{ container_name }} /bin/sh -c"
- name: generate docker exec command
set_fact: run_inside_container="docker exec -i {{ container_name }} /bin/sh -c"

- name: copy insert-docker-host.sh to host
template:
src: ../templates/insert-docker-host.sh.j2
template:
src: insert-docker-host.sh.j2
dest: /tmp/{{ grafana_service_name }}/insert-docker-host.sh
mode: 0755
become: yes
Expand Down

0 comments on commit 97c50c7

Please sign in to comment.