Skip to content

Commit

Permalink
Fix mode in ansible playbooks (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap authored Aug 26, 2020
1 parent e522eed commit 653f265
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ jobs:
# Run Linter against code base #
################################
- name: Lint Code Base
uses: docker://github/super-linter
uses: github/super-linter@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 11 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
blockinfile:
dest: /etc/environment
create: yes
mode: u=rw,g=r,o=r
block: |
{% if proxy_settings_http_proxy is defined %}
http_proxy="{{ proxy_settings_http_proxy }}"
Expand All @@ -28,6 +29,7 @@
template:
src: proxy.sh.j2
dest: /etc/profile.d/proxy.sh
mode: u=rw,g=r,o=r
tags: proxy

- name: Check if wgetrc exists
Expand All @@ -39,6 +41,7 @@
- name: Add proxy settings to wgetrc (if exists)
blockinfile:
dest: /etc/wgetrc
mode: u=rw,g=r,o=r
block: |
use_proxy = on
http_proxy = {{ proxy_settings_http_proxy }}
Expand All @@ -53,6 +56,7 @@
dest: /etc/dnf/dnf.conf
regexp: '^proxy='
line: "proxy={{ proxy_settings_yum_proxy }}"
mode: u=rw,g=r,o=r
tags: proxy
when: ansible_pkg_mgr == 'dnf' and proxy_settings_yum_proxy is defined

Expand All @@ -61,6 +65,7 @@
dest: /etc/dnf/dnf.conf
regexp: '^proxy_username='
line: "proxy_username={{ proxy_settings_yum_proxy_username }}"
mode: u=rw,g=r,o=r
tags: proxy
when: ansible_pkg_mgr == 'dnf' and proxy_settings_yum_proxy_username is defined

Expand All @@ -69,6 +74,7 @@
dest: /etc/dnf/dnf.conf
regexp: '^proxy_password='
line: "proxy_password={{ proxy_settings_yum_proxy_password }}"
mode: u=rw,g=r,o=r
tags: proxy
when: ansible_pkg_mgr == 'dnf' and proxy_settings_yum_proxy_password is defined

Expand All @@ -77,6 +83,7 @@
dest: /etc/yum.conf
regexp: '^proxy='
line: "proxy={{ proxy_settings_yum_proxy }}"
mode: u=rw,g=r,o=r
tags: proxy
when: ansible_pkg_mgr == 'yum' and proxy_settings_yum_proxy is defined

Expand All @@ -85,6 +92,7 @@
dest: /etc/yum.conf
regexp: '^proxy_username='
line: "proxy_username={{ proxy_settings_yum_proxy_username }}"
mode: u=rw,g=r,o=r
tags: proxy
when: ansible_pkg_mgr == 'yum' and proxy_settings_yum_proxy_username is defined

Expand All @@ -93,19 +101,22 @@
dest: /etc/yum.conf
regexp: '^proxy_password='
line: "proxy_password={{ proxy_settings_yum_proxy_password }}"
mode: u=rw,g=r,o=r
tags: proxy
when: ansible_pkg_mgr == 'yum' and proxy_settings_yum_proxy_password is defined

- name: Configure proxy settings for apt-get/aptitude
template:
src: 80proxy.j2
dest: /etc/apt/apt.conf.d/80proxy
mode: u=rw,g=r,o=r
tags: proxy
when: ansible_pkg_mgr == 'apt'

- name: Configure proxy settings for Suse
template:
src: proxy.j2
dest: /etc/sysconfig/proxy
mode: u=rw,g=r,o=r
tags: proxy
when: ansible_pkg_mgr == 'zypper'

0 comments on commit 653f265

Please sign in to comment.