Skip to content

Commit

Permalink
Changed to use single quotes in YAML where possible (#106)
Browse files Browse the repository at this point in the history
Avoid unnecessary escape sequence processing.
  • Loading branch information
freemanjp authored Apr 7, 2018
1 parent 9c77dfd commit 5e2a023
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
18 changes: 9 additions & 9 deletions tasks/install-extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: install extension cli dependencies
become: yes
apt:
name: "{{ item }}"
name: '{{ item }}'
state: present
with_items:
- gconf2
Expand All @@ -12,34 +12,34 @@

- name: create config directories for users
become: yes
become_user: "{{ item.0.username }}"
become_user: '{{ item.0.username }}'
file:
path: "~{{ item.0.username }}/.config"
path: '~{{ item.0.username }}/.config'
state: directory
mode: 'u=rwx,go=r'
with_subelements:
- "{{ users }}"
- '{{ users }}'
- visual_studio_code_extensions
- skip_missing: yes

- name: create Visual Studio Code directories for users
become: yes
become_user: "{{ item.0.username }}"
become_user: '{{ item.0.username }}'
file:
path: "~{{ item.0.username }}/.config/Code/User"
path: '~{{ item.0.username }}/.config/Code/User'
state: directory
mode: 'u=rwx,go='
with_subelements:
- "{{ users }}"
- '{{ users }}'
- visual_studio_code_extensions
- skip_missing: yes

- name: install extensions
become: yes
become_user: "{{ item.0.username }}"
become_user: '{{ item.0.username }}'
command: "code --install-extension '{{ item.1 }}'"
with_subelements:
- "{{ users }}"
- '{{ users }}'
- visual_studio_code_extensions
- skip_missing: yes
register: vscode_result
Expand Down
14 changes: 7 additions & 7 deletions tasks/install.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
- name: load version vars
with_first_found:
- "../vars/versions/{{ visual_studio_code_version }}.yml"
- '../vars/versions/{{ visual_studio_code_version }}.yml'
- ../vars/versions/default.yml
include_vars: "{{ item }}"
include_vars: '{{ item }}'

- name: assert version vars
assert:
Expand All @@ -15,7 +15,7 @@
file:
state: directory
mode: 'u=rwx,go=rx'
dest: "{{ visual_studio_code_download_dir }}"
dest: '{{ visual_studio_code_download_dir }}'

- name: ensure ca-certificates installed
become: yes
Expand All @@ -25,9 +25,9 @@

- name: download Visual Studio Code
get_url:
url: "{{ visual_studio_code_redis_url }}"
dest: "{{ visual_studio_code_download_dir }}/{{ visual_studio_code_redis_filename }}"
sha256sum: "{{ visual_studio_code_redis_sha256sum }}"
url: '{{ visual_studio_code_redis_url }}'
dest: '{{ visual_studio_code_download_dir }}/{{ visual_studio_code_redis_filename }}'
sha256sum: '{{ visual_studio_code_redis_sha256sum }}'
force: no
use_proxy: yes
validate_certs: yes
Expand All @@ -36,4 +36,4 @@
- name: install Visual Studio Code
become: yes
apt:
deb: "{{ visual_studio_code_download_dir }}/{{ visual_studio_code_redis_filename }}"
deb: '{{ visual_studio_code_download_dir }}/{{ visual_studio_code_redis_filename }}'
4 changes: 2 additions & 2 deletions tasks/write-settings.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: create settings directory
become: yes
become_user: "{{ item.username }}"
become_user: '{{ item.username }}'
file:
path: '~{{ item.username }}/.config/Code/User'
state: directory
Expand All @@ -10,7 +10,7 @@

- name: write settings
become: yes
become_user: "{{ item.username }}"
become_user: '{{ item.username }}'
template:
src: settings.json.j2
dest: '~{{ item.username }}/.config/Code/User/settings.json'
Expand Down
2 changes: 1 addition & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
# Filename of Visual Studio Code redistributable package
visual_studio_code_redis_filename: "code_{{ visual_studio_code_version }}_amd64.deb"
visual_studio_code_redis_filename: 'code_{{ visual_studio_code_version }}_amd64.deb'

0 comments on commit 5e2a023

Please sign in to comment.