---
# Add .gitconfig, _netrc, and .boto files to a Skolo bot.
- hosts: all
  tasks:
  # We use a shotgun approach to ensure .gitconfig, _netrc, and .boto exist anywhere they might be
  # needed.
  - name: Copy gitconfig to root
    win_copy:
      src: "{{ win_package_src }}/.gitconfig"
      dest: c:\
  - name: Copy gitconfig to home
    win_copy:
      src: "{{ win_package_src }}/.gitconfig"
      dest: c:\Users\chrome-bot\
  - name: Copy netrc to root
    win_copy:
      src: "{{ win_package_src }}/_netrc"
      dest: c:\
  - name: Copy netrc to home
    win_copy:
      src: "{{ win_package_src }}/_netrc"
      dest: c:\Users\chrome-bot\
  # .boto doesn't need to contain anything, just needs to be present.
  - name: Create boto in root
    win_file:
      path: c:\.boto
      state: touch
  - name: Create boto in home
    win_file:
      path: c:\Users\chrome-bot\.boto
      state: touch

---
# Add .gitconfig, _netrc, .boto, and oauth2_access_token_config.json files to a Skolo bot. Add
# metadata server to hosts file.
- hosts: all
  tasks:
  # We use a shotgun approach to ensure .gitconfig, _netrc, and .boto exist anywhere they might be
  # needed.
  - name: Copy gitconfig to root
    win_copy:
      src: "{{ win_package_src }}/.gitconfig"
      dest: c:\
  - name: Copy gitconfig to home
    win_copy:
      src: "{{ win_package_src }}/.gitconfig"
      dest: c:\Users\chrome-bot\
  - name: Copy netrc to root
    win_copy:
      src: "{{ win_package_src }}/_netrc"
      dest: c:\
  - name: Copy netrc to home
    win_copy:
      src: "{{ win_package_src }}/_netrc"
      dest: c:\Users\chrome-bot\
  # .boto doesn't need to contain anything, just needs to be present.
  - name: Create boto in root
    win_file:
      path: c:\.boto
      state: touch
  - name: Create boto in home
    win_file:
      path: c:\Users\chrome-bot\.boto
      state: touch
  - name: Copy oauth2_access_token_config.json to swarming_config
    win_copy:
      src: ../../common/oauth2_access_token_config.json
      dest: C:\swarming_config\
  - name: Add metadata server to hosts file.
    # This shouldn't be necessary, but I ran into
    # https://superuser.com/questions/495759/why-is-ping-unable-to-resolve-a-name-when-nslookup-works-fine
    # and none of the solutions worked.
    win_lineinfile:
      path: c:\Windows\System32\Drivers\etc\hosts
      line: "192.168.1.20 metadata"

Add oauth config to Windows Ansible script.
[skolo] Add oauth config to Windows Ansible script.

Bug: skia:7460
Change-Id: I562fa18cd9280939b70e5254bbe050fd0608d15d
Reviewed-on: https://skia-review.googlesource.com/108190
Reviewed-by: Eric Boren <0e499112533c8544f0505ea0d08394fb5ad7d8fa@google.com>
Commit-Queue: Ben Wagner <3ef7217be91069877d94f7907ce5479000772cd3@google.com>
