wate
4/2/2017 - 6:38 AM

[title]install "Unofficial" CLI client for the Sakura Cloud

[title]install "Unofficial" CLI client for the Sakura Cloud

---
# Usage
# ---------------------------------
#
# ```
# ansible -i 127.0.0.1, install_usacloud.yml -c local
# ```
#
- hosts: all
  tasks:
    - block:
      - homebrew_tap:
          name: sacloud/homebrew-usacloud
      - homebrew:
          name: usacloud
          state: latest
      when: ansible_os_family == 'Darwin'
      become: false
    - block:
      - rpm_key:
          key: https://usacloud.b.sakurastorage.jp/repos/GPG-KEY-usacloud
      - yum_repository:
          name: usacloud
          description: usacloud
          baseurl: https://usacloud.b.sakurastorage.jp/repos/centos/$basearch
          gpgcheck: true
          file: usacloud
      - yum:
          name: usacloud
          state: latest
      when: ansible_os_family == 'RedHat'
      become: true
    - block:
      - apt_key:
          url: https://usacloud.b.sakurastorage.jp/repos/GPG-KEY-usacloud
      - apt_repository:
          repo: deb https://usacloud.b.sakurastorage.jp/repos/debian /
          filename: usacloud
      - apt:
          name: usacloud
          update_cache: true
          state: latest
      when: ansible_os_family == 'Debian'
      become: true