diff --git a/roles/developer/tasks/git-workspace.yml b/roles/developer/tasks/git-workspace.yml index d1687d7..d390911 100644 --- a/roles/developer/tasks/git-workspace.yml +++ b/roles/developer/tasks/git-workspace.yml @@ -6,19 +6,16 @@ ## (see: https://stackoverflow.com/questions/15935624/how-do-i-avoid-empty-sections-when-removing-a-setting-from-git-config) #- name: keep url section # command: git config -f "{{ ansible_env.HOME }}/.config/git/{{ workspace.name }}.inc" "url.{{ item.base }}.placeholder" placeholder -# with_items: "{{ workspace.insteadOfs }}" +# loop: "{{ workspace.insteadOfs }}" - name: remove workspace insteadOf values command: git config unset -f "{{ ansible_env.HOME }}/.config/git/{{ workspace.name }}.inc" --all "url.{{ item.base | default("") }}.insteadOf" - with_items: "{{ workspace.insteadOfs | default([]) }}" + loop: "{{ workspace.insteadOfs | default([]) }}" when: item.base is defined - name: git config workspace insteadOf command: git config -f "{{ ansible_env.HOME }}/.config/git/{{ workspace.name }}.inc" --add url.{{ item.0.base }}.insteadOf "{{ item.1 }}" - with_subelements: - - "{{ workspace.insteadOfs | default([]) }}" - - urls - - skip_missing: yes + loop: "{{ workspaces.insteadOfs | default([]) | subelements('urls', skip_missing=True) }}" - name: git config includeIf workspace command: git config --global --replace-all includeIf."gitdir:{{ workspace.gitdir }}".path {{ workspace.name }}.inc diff --git a/roles/developer/tasks/git.yml b/roles/developer/tasks/git.yml index eea422f..534ef0c 100644 --- a/roles/developer/tasks/git.yml +++ b/roles/developer/tasks/git.yml @@ -88,19 +88,16 @@ # (see: https://stackoverflow.com/questions/15935624/how-do-i-avoid-empty-sections-when-removing-a-setting-from-git-config) #- name: keep url section # command: git config --global "url.{{ item.base }}.placeholder" placeholder -# with_items: "{{ insteadOfs }}" +# loop: "{{ insteadOfs }}" # - name: remove insteadOf values command: git config unset --global --all "url.{{ item.base }}.insteadOf" - with_items: "{{ insteadOfs }}" + loop: "{{ insteadOfs }}" when: item.base is defined - name: git config insteadOf command: git config --global --add url.{{ item.0.base }}.insteadOf "{{ item.1 }}" - with_subelements: - - "{{ insteadOfs }}" - - urls - - skip_missing: yes + loop: "{{ insteadOfs | subelements('urls', skip_missing=True) }}" - name: git config web.browser command: git config --global web.browser open @@ -125,7 +122,7 @@ # TODO(bc): replace include with include_tasks in Ansible 2.4 - include_tasks: git-workspace.yml - with_items: "{{ workspaces }}" + loop: "{{ workspaces }}" when: workspaces | default([], true) loop_control: loop_var: workspace diff --git a/roles/developer/tasks/install-go.yml b/roles/developer/tasks/install-go.yml index 3895ad0..fdce7be 100644 --- a/roles/developer/tasks/install-go.yml +++ b/roles/developer/tasks/install-go.yml @@ -25,7 +25,7 @@ GOOS: "{{ item | lower }}" GOARCH: amd64 PATH: /usr/local/go/bin:{{ ansible_env.PATH }} - with_items: + loop: - Linux - Darwin when: ansible_system != item diff --git a/roles/developer/tasks/main.yml b/roles/developer/tasks/main.yml index 5f454ec..2efd739 100644 --- a/roles/developer/tasks/main.yml +++ b/roles/developer/tasks/main.yml @@ -8,7 +8,7 @@ # state: latest # virtualenv: "{{ venv }}" # virtualenv_command: "python3 -m venv" -# with_items: +# loop: # tags: # - packages # - python diff --git a/roles/developer/tasks/packages_Debian.yml b/roles/developer/tasks/packages_Debian.yml index e39ff7b..0fca5d0 100644 --- a/roles/developer/tasks/packages_Debian.yml +++ b/roles/developer/tasks/packages_Debian.yml @@ -67,7 +67,7 @@ #- name: install packages # homebrew_cask: name="{{ item }}" state=present -# with_items: +# loop: # - slack # tags: # - packages diff --git a/roles/developer/tasks/proto.yml b/roles/developer/tasks/proto.yml index 60e3407..5b59dae 100644 --- a/roles/developer/tasks/proto.yml +++ b/roles/developer/tasks/proto.yml @@ -17,5 +17,5 @@ command: go install google.golang.org/protobuf/{{ item }}@latest #environment: # GOPATH: "{{ansible_env.GOPATH}}" - with_items: + loop: - cmd/protoc-gen-go