Skip to content

Commit

Permalink
Merge pull request #236 from DataDog/kbogtob/improve-ansible-score
Browse files Browse the repository at this point in the history
Improving Ansible score by removing bad practises
  • Loading branch information
kbogtob authored Dec 23, 2019
2 parents 9dbde30 + 1ddbcd6 commit e81d5c9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,3 @@ workflows:
- centos_28_5
- centos_28_6
- centos_28_7

2 changes: 2 additions & 0 deletions tasks/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

- name: Removing integrations (Windows)
win_command: "\"{{ datadog_agent_binary_path }}\" integration remove {{ item.key }}"
become: yes
become_user: "{{ integration_command_user }}"
loop: "{{ datadog_integration|dict2items }}"
when: item.value.action == "remove" and ansible_os_family == "Windows"
Expand All @@ -61,6 +62,7 @@

- name: Install pinned version of integrations (Windows)
win_command: "\"{{ datadog_agent_binary_path }}\" integration install {{ item.key }}=={{ item.value.version }}"
become: yes
become_user: "{{ integration_command_user }}"
loop: "{{ datadog_integration|dict2items }}"
when: item.value.action == "install" and ansible_os_family == "Windows"
12 changes: 6 additions & 6 deletions tasks/pkg-suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
path: /tmp/DATADOG_RPM_KEY.public
register: ddkey
- name: Download RPM key (SLES11)
shell: "curl {{ datadog_zypper_gpgkey }} -o /tmp/DATADOG_RPM_KEY.public"
args:
warn: no
get_url:
url: "{{ datadog_zypper_gpgkey }}"
dest: /tmp/DATADOG_RPM_KEY.public
when: not ddkey.stat.exists
when: datadog_agent_major_version|int < 7 and ansible_distribution_version|int == 11

Expand All @@ -32,9 +32,9 @@
path: /tmp/DATADOG_RPM_KEY_E09422B3.public
register: ddnewkey
- name: Download new RPM key (SLES11)
shell: "curl {{ datadog_zypper_gpgkey_e09422b3 }} -o /tmp/DATADOG_RPM_KEY_E09422B3.public"
args:
warn: no
get_url:
url: "{{ datadog_zypper_gpgkey_e09422b3 }}"
dest: /tmp/DATADOG_RPM_KEY_E09422B3.public
when: not ddnewkey.stat.exists
when: ansible_distribution_version|int == 11

Expand Down
4 changes: 2 additions & 2 deletions tasks/pkg-windows-opts.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
- name: Set DD Username Arg
set_fact:
win_install_args: "{{ win_install_args }} DDAGENTUSER_NAME={{ datadog_windows_ddagentuser_name }}"
when: datadog_windows_ddagentuser_name != ""
when: datadog_windows_ddagentuser_name | length > 0

- name: Set DD Password Arg
set_fact:
win_install_args: "{{ win_install_args }} DDAGENTUSER_PASSWORD={{ datadog_windows_ddagentuser_password }}"
when: datadog_windows_ddagentuser_password != ""
when: datadog_windows_ddagentuser_password | length > 0

- name: Set Test
set_fact:
Expand Down

0 comments on commit e81d5c9

Please sign in to comment.