Skip to content

Commit

Permalink
Update yml files after linting (NO_JIRA)
Browse files Browse the repository at this point in the history
  • Loading branch information
siong-chin committed Oct 27, 2023
1 parent 5a90814 commit 2fcc894
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 29 deletions.
4 changes: 2 additions & 2 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ galaxy_info:
description: C++ compiler deployment and setup for CCDC build machines.
company: The Cambridge Crystallographic Data Centre
license: "license (BSD, MIT)"
min_ansible_version: 2.9
min_ansible_version: "2.9"
platforms:
- name: EL
versions:
Expand All @@ -21,7 +21,7 @@ galaxy_info:
- all
- name: MacOSX
versions:
- 10.15
- all
- name: Windows
versions:
- all
Expand Down
6 changes: 3 additions & 3 deletions tasks/CentOS.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Install build tools
yum:
ansible.builtin.yum:
name:
- devtoolset-10
- llvm-toolset-10.0
Expand All @@ -12,14 +12,14 @@

- name: Enable devtoolset globally for all users
# See https://developers.redhat.com/blog/2014/03/19/permanently-enable-a-software-collection/
copy:
ansible.builtin.copy:
src: enable-devtoolset.sh
dest: /etc/profile.d/enable-devtoolset.sh
mode: u=rwx,g=rx,o=rx
become: true

- name: Enable llvm-toolset globally for all users
copy:
ansible.builtin.copy:
src: enable-llvm-toolset.sh
dest: /etc/profile.d/enable-llvm-toolset.sh
mode: u=rwx,g=rx,o=rx
Expand Down
30 changes: 17 additions & 13 deletions tasks/Darwin.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
- name: Check for existing Xcode installation
stat:
ansible.builtin.stat:
path: "/Applications/Xcode_{{ xcode_version }}.app"
register: xcode_app

- name: "Download XCode {{ xcode_version }}"
shell: >
ansible.builtin.shell: >
jfrog rt dl
--flat
--fail-no-op
Expand All @@ -21,45 +21,49 @@
JFROG_CLI_OFFER_CONFIG: "false"
when: xcode_app.stat.isdir is not defined or not xcode_app.stat.isdir
register: download
args:
creates: "~/Downloads/Xcode_{{ xcode_version }}.xip"

- name: Extract XCode archive
command: xip -x ~/Downloads/Xcode_{{ xcode_version }}.xip
ansible.builtin.command: xip -x ~/Downloads/Xcode_{{ xcode_version }}.xip
args:
chdir: "/Applications"
creates: "/Applications/Xcode.app"
when: xcode_app.stat.isdir is not defined or not xcode_app.stat.isdir
register: extract_xcode_xip

- name: Move XCode to /Applications/Xcode_{{ xcode_version }}.app
command: mv /Applications/Xcode.app /Applications/Xcode_{{ xcode_version }}.app
- name: Move XCode to /Applications/Xcode_{{ xcode_version }}.app # noqa: name[template]
ansible.builtin.command: mv /Applications/Xcode.app /Applications/Xcode_{{ xcode_version }}.app
when: xcode_app.stat.isdir is not defined or not xcode_app.stat.isdir
args:
creates: "/Applications/Xcode_{{ xcode_version }}.app"

- name: Remove downloaded Xcode archive
file:
ansible.builtin.file:
state: absent
path: "~/Downloads/Xcode_{{ xcode_version }}.xip"

- name: switch to /Applications/Xcode_{{ xcode_version }}.app # noqa: no-changed-when
command: xcode-select --switch /Applications/Xcode_{{ xcode_version }}.app/Contents/Developer
- name: Switch to /Applications/Xcode_{{ xcode_version }}.app # noqa: no-changed-when,name[template]

Check failure on line 46 in tasks/Darwin.yml

View workflow job for this annotation

GitHub Actions / Linting

name[template]

Jinja templates should only be at the end of 'name'

Check failure on line 46 in tasks/Darwin.yml

View workflow job for this annotation

GitHub Actions / Linting

no-changed-when

Commands should not change things if nothing needs doing.

Check notice on line 46 in tasks/Darwin.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

[ansible-lint] tasks/Darwin.yml#L46

no-changed-when Commands should not change things if nothing needs doing
Raw output
tasks/Darwin.yml:46: no-changed-when Commands should not change things if nothing needs doing
ansible.builtin.command: xcode-select --switch /Applications/Xcode_{{ xcode_version }}.app/Contents/Developer
become: true

- name: Accept Xcode licence # noqa: no-changed-when
command: xcodebuild -license accept
ansible.builtin.command: xcodebuild -license accept
become: true

- name: Get list of installed packages # noqa: no-changed-when
command: pkgutil --pkgs
ansible.builtin.command: pkgutil --pkgs
register: pkgutil_packages

- name: Get list of packages available with Xcode
find:
ansible.builtin.find:
path: /Applications/Xcode_{{ xcode_version }}.app/Contents/Resources/Packages/
patterns: "*.pkg"
recurse: no
register: packages

- name: Install Xcode packages
include: install-pkg.yml
- name: Install Xcode packages # noqa: deprecated-module
ansible.builtin.include: install-pkg.yml
vars:
package_file: "{{ package }}"
package_list: "{{ pkgutil_packages.stdout }}"
Expand Down
2 changes: 1 addition & 1 deletion tasks/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Install build tools
apt:
ansible.builtin.apt:
name:
- build-essential
state: present
Expand Down
4 changes: 2 additions & 2 deletions tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@

- name: Enable devtoolset globally for all users
# See https://developers.redhat.com/blog/2014/03/19/permanently-enable-a-software-collection/
copy:
ansible.builtin.copy:
src: enable-devtoolset.sh
dest: /etc/profile.d/enable-devtoolset.sh
mode: u=rwx,g=rx,o=rx
become: true

- name: Enable llvm-toolset globally for all users
copy:
ansible.builtin.copy:
src: enable-llvm-toolset.sh
dest: /etc/profile.d/enable-llvm-toolset.sh
mode: u=rwx,g=rx,o=rx
Expand Down
6 changes: 3 additions & 3 deletions tasks/Windows.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
- name: Install visualstudio2019professional (SLOW)
win_chocolatey:
chocolatey.chocolatey.win_chocolatey:
name: visualstudio2019professional
state: present

- name: Install visualstudio2019-workload-nativedesktop (SLOW)
win_chocolatey:
chocolatey.chocolatey.win_chocolatey:
name: visualstudio2019-workload-nativedesktop
state: present

- name: Install visualstudio2019-remotetools
win_chocolatey:
chocolatey.chocolatey.win_chocolatey:
name: visualstudio2019-remotetools
state: present
8 changes: 4 additions & 4 deletions tasks/install-pkg.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
- name: read package info # noqa: no-changed-when
command: installer -pkginfo -pkg "{{ package_file }}"
- name: Read package info # noqa: no-changed-when
ansible.builtin.command: installer -pkginfo -pkg "{{ package_file }}"
register: package_pkginfo

- name: install package
command: installer -pkg "{{ package_file }}" -target /
- name: Install package #noqa: no-changed-when

Check failure on line 6 in tasks/install-pkg.yml

View workflow job for this annotation

GitHub Actions / Linting

no-changed-when

Commands should not change things if nothing needs doing.
ansible.builtin.command: installer -pkg "{{ package_file }}" -target /
when: package_pkginfo.stdout not in package_list
become: true
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Set up C++ compilers
include_tasks: "{{ taskfile }}"
ansible.builtin.include_tasks: "{{ taskfile }}"
with_first_found:
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_distribution }}.yml"
Expand Down

0 comments on commit 2fcc894

Please sign in to comment.