├── ansible.cfg ├── requirements.yml ├── tasks ├── osx.yml ├── sudoers.yml ├── docks.yml └── extra.yml ├── .travis.yml ├── templates ├── zshrc-linux.j2 ├── zshrc-osx.j2 └── sudoers.j2 ├── files └── upgrade.sh ├── run.sh ├── .gitignore ├── run.playbook.yml ├── README.md ├── config.yml └── LICENSE /ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | inventory = "localhost," 3 | roles_path = ./roles -------------------------------------------------------------------------------- /requirements.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: geerlingguy.dotfiles 4 | - name: geerlingguy.homebrew 5 | - name: geerlingguy.mas -------------------------------------------------------------------------------- /tasks/osx.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | # TODO: Use sudo once .osx can be run via root with no user interaction. 4 | - name: Run .osx dotfiles 5 | shell: "{{ osx_script }}" 6 | changed_when: false -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | language: python 4 | python: "2.7" 5 | cache: pip 6 | 7 | install: 8 | - pip install ansible 9 | 10 | before_script: 11 | - ansible-galaxy install -r requirements.yml -p roles 12 | 13 | script: 14 | - ansible-playbook run.playbook.yml --syntax-check -------------------------------------------------------------------------------- /templates/zshrc-linux.j2: -------------------------------------------------------------------------------- 1 | # Path to your oh-my-zsh installation. 2 | export ZSH="/home/zoph/.oh-my-zsh" 3 | 4 | ZSH_THEME="../custom/themes/spaceship-prompt/spaceship" 5 | 6 | HIST_STAMPS="dd/mm/yyyy" 7 | 8 | plugins=(battery git brew docker github node npm osx pip python zsh-completions zsh-syntax-highlighting) 9 | 10 | source $ZSH/oh-my-zsh.sh 11 | source ~/.zshrc.local -------------------------------------------------------------------------------- /templates/zshrc-osx.j2: -------------------------------------------------------------------------------- 1 | # Path to your oh-my-zsh installation. 2 | export ZSH="/Users/zoph/.oh-my-zsh" 3 | 4 | ZSH_THEME="../custom/themes/spaceship-prompt/spaceship" 5 | 6 | HIST_STAMPS="dd/mm/yyyy" 7 | 8 | plugins=(battery git brew docker github node npm osx pip python zsh-completions zsh-syntax-highlighting) 9 | 10 | source $ZSH/oh-my-zsh.sh 11 | source ~/.zshrc.local -------------------------------------------------------------------------------- /files/upgrade.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | terminal-notifier -message "Brew | update" 4 | brew update 5 | terminal-notifier -message "Brew | upgrade" 6 | brew upgrade 7 | terminal-notifier -message "Brew | cleanup" 8 | brew cleanup -s 9 | terminal-notifier -message "Brew | doctor" 10 | brew doctor 11 | terminal-notifier -message "Brew | missing" 12 | brew missing 13 | terminal-notifier -message "AppleStore | Update all" 14 | mas outdated 15 | mas upgrade -------------------------------------------------------------------------------- /tasks/sudoers.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Register path to sed. 3 | command: which sed 4 | register: sed_which_result 5 | changed_when: false 6 | when: sed_path is undefined 7 | 8 | - name: Define sed_path variable. 9 | set_fact: 10 | sed_path: "{{ sed_which_result.stdout }}" 11 | when: sed_path is undefined 12 | 13 | - name: Copy sudoers configuration into place. 14 | template: 15 | src: templates/sudoers.j2 16 | dest: /etc/sudoers 17 | mode: 0440 18 | validate: 'visudo -cf %s' 19 | become: yes -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Use : sh run.sh 3 | set -e 4 | 5 | CURRENT=$PWD 6 | 7 | # install xcode 8 | #xcode-select --install 9 | 10 | # install homebrew + homebrew cask 11 | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 12 | brew update 13 | 14 | # install pip 15 | sudo easy_install pip 16 | 17 | # install ansible 18 | brew install ansible 19 | 20 | # get roles 21 | ansible-galaxy install -r requirements.yml -p roles 22 | 23 | # launch playbook 24 | ansible-playbook run.playbook.yml --ask-become-pass 25 | 26 | cd $CURRENT -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | roles 2 | .idea 3 | .DS_Store 4 | .vscode 5 | *.retry 6 | 7 | # General 8 | .DS_Store 9 | .AppleDouble 10 | .LSOverride 11 | 12 | # Icon must end with two \r 13 | Icon 14 | 15 | 16 | # Thumbnails 17 | ._* 18 | 19 | # Files that might appear in the root of a volume 20 | .DocumentRevisions-V100 21 | .fseventsd 22 | .Spotlight-V100 23 | .TemporaryItems 24 | .Trashes 25 | .VolumeIcon.icns 26 | .com.apple.timemachine.donotpresent 27 | 28 | # Directories potentially created on remote AFP share 29 | .AppleDB 30 | .AppleDesktop 31 | Network Trash Folder 32 | Temporary Items 33 | .apdisk 34 | -------------------------------------------------------------------------------- /tasks/docks.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Dockutil | Remove all unwanted dock items 4 | shell: dockutil --remove "{{ item }}" 5 | ignore_errors: true 6 | with_items: "{{ dockitems_disabled }}" 7 | when: "{{ dockitems_disabled | length > 0 }}" 8 | 9 | - name: Dockutil | Adding items 10 | shell: dockutil --find "{{ item.name }}" || dockutil --add "{{ item.path }}" 11 | with_items: "{{ dockitems_enabled }}" 12 | when: "{{ dockitems_enabled | length > 0 }}" 13 | 14 | - name: Dockutil | Moving items 15 | shell: dockutil --move "{{ item.name }}" --position "{{ item.pos }}" 16 | with_items: "{{ dockitems_enabled }}" 17 | when: "{{ dockitems_enabled | length > 0 }}" -------------------------------------------------------------------------------- /run.playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - hosts: localhost 4 | connection: local 5 | 6 | vars_files: 7 | - config.yml 8 | 9 | pre_tasks: 10 | - name: "change security" 11 | command: spctl --master-disable 12 | become: yes 13 | 14 | - import_tasks: tasks/sudoers.yml 15 | when: configure_sudoers 16 | 17 | roles: 18 | - role: geerlingguy.mas 19 | when: mas_installed_apps 20 | 21 | - role: geerlingguy.homebrew 22 | when: homebrew_installed_packages 23 | 24 | - role: geerlingguy.dotfiles 25 | when: configure_dotfiles 26 | 27 | tasks: 28 | - import_tasks: tasks/osx.yml 29 | when: configure_osx 30 | 31 | - import_tasks: tasks/extra.yml 32 | when: configure_extra 33 | 34 | - import_tasks: tasks/docks.yml 35 | when: configure_dock 36 | 37 | - name: Reboot 38 | command: reboot 39 | become: yes -------------------------------------------------------------------------------- /tasks/extra.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: "ZSH | Download theme" 4 | git: 5 | repo: "https://github.com/denysdovhan/spaceship-prompt.git" 6 | dest: "~/.oh-my-zsh/custom/themes/spaceship-prompt/" 7 | 8 | - name: "ZSH | Download plugins zsh-completions" 9 | git: 10 | repo: "git://github.com/zsh-users/zsh-completions" 11 | dest: "~/.oh-my-zsh/custom/plugins/zsh-completions/" 12 | 13 | - name: "ZSH | Download plugins zsh-syntax-highlighting" 14 | git: 15 | repo: "git://github.com/zsh-users/zsh-syntax-highlighting.git" 16 | dest: "~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/" 17 | 18 | - name: "ZSH | Copy config" 19 | template: 20 | src: "~/.dotfiles/.zshrc" 21 | dest: "~/.zshrc" 22 | 23 | - name: "ZSH | Copy alias.sh" 24 | template: 25 | src: "~/.dotfiles/.alias.sh" 26 | dest: "~/.alias.sh" 27 | 28 | - name: "ZSH | Define default shell" 29 | command: "chsh -s /bin/zsh" 30 | 31 | - name: "Install oh-my-zsh" 32 | shell: "curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | bash" 33 | 34 | - name: "Install zsh pure-prompt" 35 | shell: "npm install --global pure-prompt" 36 | 37 | - name: "Add Jeedom to hosts file" 38 | lineinfile: 39 | dest: /etc/hosts 40 | line: '192.168.1.14 alfred.zoph.me' -------------------------------------------------------------------------------- /templates/sudoers.j2: -------------------------------------------------------------------------------- 1 | # sudoers file. 2 | # 3 | # This file MUST be edited with the 'visudo' command as root. 4 | # Failure to use 'visudo' may result in syntax or file permission errors 5 | # that prevent sudo from running. 6 | # 7 | # See the sudoers man page for the details on how to write a sudoers file. 8 | # 9 | 10 | # Host alias specification 11 | 12 | # User alias specification 13 | 14 | # Cmnd alias specification 15 | 16 | # Defaults specification 17 | Defaults env_reset 18 | Defaults env_keep += "BLOCKSIZE" 19 | Defaults env_keep += "COLORFGBG COLORTERM" 20 | Defaults env_keep += "__CF_USER_TEXT_ENCODING" 21 | Defaults env_keep += "CHARSET LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE" 22 | Defaults env_keep += "LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME" 23 | Defaults env_keep += "LINES COLUMNS" 24 | Defaults env_keep += "LSCOLORS" 25 | Defaults env_keep += "SSH_AUTH_SOCK" 26 | Defaults env_keep += "TZ" 27 | Defaults env_keep += "DISPLAY XAUTHORIZATION XAUTHORITY" 28 | Defaults env_keep += "EDITOR VISUAL" 29 | Defaults env_keep += "HOME MAIL" 30 | 31 | # Runas alias specification 32 | 33 | # User privilege specification 34 | root ALL=(ALL) ALL 35 | %admin ALL=(ALL) NOPASSWD: ALL 36 | 37 | # Uncomment to allow people in group wheel to run all commands 38 | # %wheel ALL=(ALL) ALL 39 | 40 | # Same thing without a password 41 | # %wheel ALL=(ALL) NOPASSWD: ALL 42 | 43 | # Samples 44 | # %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom 45 | # %users localhost=/sbin/shutdown -h now -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ansible Playbook for Mac install 2 | 3 | [![Build Status](https://travis-ci.org/z0ph/ansible-mac-install.svg?branch=master)](https://travis-ci.org/z0ph/ansible-mac-install) 4 | 5 | Tested on macOS: `10.14.1 (18B2107)` 6 | 7 | ## Disclaimer 8 | 9 | This installation is setup for my own usage, and to my needs. Please adapt the configuration. 10 | This playbook comes from [flemzord](https://github.com/flemzord/ansible-mac-install), and [geerlingguy](https://github.com/geerlingguy/mac-dev-playbook) 11 | 12 | ## Installation 13 | 14 | On a fresh macOS installation: 15 | 16 | 1. Run `xcode-select --install` to install minimal tools (git, ...) 17 | 2. Fork, then Clone this repository to your local drive. 18 | 3. Change and adapt to your needs the configuration in ```config.yml```. 19 | 4. Run ```sh run.sh``` from your brand new macOS installation. 20 | 5. Don't forget to commit & push your changes for your next installation. 21 | 22 | ## Upgrade 23 | 24 | To upgrade your macOS installation: 25 | 26 | $ sh files/upgrade.sh 27 | 28 | ## Options 29 | 30 | ### Configure dotfiles 31 | 32 | To enable the configuration of dotfiles, and download from your own repository. 33 | 34 | `configure_dotfiles: yes` 35 | 36 | configure the following options in `config.yml` 37 | 38 | ```yml 39 | dotfiles_repo: https://github.com/your/dotfiles_repo.git 40 | dotfiles_repo_accept_hostkey: yes 41 | dotfiles_repo_local_destination: ~/.dotfiles # destination 42 | dotfiles_files: # file to download 43 | - .gitignore 44 | - .osx 45 | - .zshrc 46 | - .alias.sh 47 | - .bashrc 48 | ``` 49 | 50 | ### Configure sudoers 51 | 52 | Register `sed` and copy sudoers template. 53 | 54 | `configure_sudoers: yes` 55 | 56 | ### Configure osx 57 | 58 | configure macOS with `.osx` file 59 | 60 | `configure_osx: no` 61 | 62 | ### Configure extra 63 | 64 | Configure few personal stuffs: 65 | 66 | * Install zsh theme 67 | * Install zsh plugins 68 | * Set zsh as default shell 69 | * Install oh-my-zsh 70 | * Install pure-prompt 71 | * Set an `/etc/hosts` entry 72 | 73 | `configure_extra: yes` 74 | 75 | ### Configure dock 76 | 77 | Remove and add icons in the dock 78 | 79 | `configure_dock: yes` -------------------------------------------------------------------------------- /config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | project_dir: ~/.script 4 | downloads_dir: ~/Downloads 5 | 6 | downloads: ~/.ansible-downloads/ 7 | 8 | # Options 9 | configure_dotfiles: yes 10 | configure_sudoers: yes 11 | configure_osx: no 12 | configure_extra: yes 13 | configure_dock: yes 14 | 15 | # dotfiles options 16 | dotfiles_repo: https://github.com/z0ph/dotfiles.git 17 | dotfiles_repo_accept_hostkey: yes 18 | dotfiles_repo_local_destination: ~/.dotfiles 19 | dotfiles_files: 20 | - .alias.sh 21 | - .bashrc 22 | - .osx 23 | - .zshrc 24 | 25 | homebrew_taps: 26 | - homebrew/cask 27 | - wallix/awless 28 | - homebrew/cask-fonts 29 | - homebrew/cask-versions 30 | - aws/tap 31 | - lucagrulla/tap 32 | 33 | homebrew_installed_packages: 34 | - asciinema 35 | - autoconf 36 | - automake 37 | - awless 38 | - aws-okta 39 | - aws-sam-cli 40 | - aws-shell 41 | - awscli 42 | - bash-completion 43 | - calc 44 | - cfn-lint 45 | - coreutils 46 | - curl 47 | - cw 48 | - direnv 49 | - docker 50 | - dockutil 51 | - git 52 | - git-secrets 53 | - github/gh/gh 54 | - gnupg 55 | - gnutls 56 | - go 57 | - gpg 58 | - htop 59 | - httpie 60 | - hugo 61 | - hydra 62 | - ipcalc 63 | - iperf3 64 | - jq 65 | - kubernetes-cli 66 | - kubernetes-helm 67 | - lftp 68 | - libgcrypt 69 | - mas 70 | - ncdu 71 | - neovim 72 | - nmap 73 | - node 74 | - nvm 75 | - openssl 76 | - packer 77 | - pinentry-mac 78 | - python 79 | - python3 80 | - ruby 81 | - speedtest-cli 82 | - sqlite 83 | - ssh-copy-id 84 | - telnet 85 | - terminal-notifier 86 | - terraform 87 | - tldr 88 | - tmux 89 | - tree 90 | - unrar 91 | - vim 92 | - watch 93 | - wget 94 | - wireshark 95 | - zsh 96 | 97 | homebrew_cask_appdir: /Applications 98 | homebrew_cask_apps: 99 | - aerial # screensaver 100 | - alfred 101 | - aws-vault 102 | - brave-browser 103 | - cleanmymac 104 | - cyberduck # ftp client 105 | - discord 106 | - docker 107 | - dropbox 108 | - enpass # password manager 109 | - firefox 110 | - fliqlo # screensaver 111 | - font-fira-mono-for-powerline 112 | - font-jetbrains-mono # prefer font size 13 113 | - font-source-code-pro # font for zsh 114 | - franz # client whatsapp, telegram, slack, etc. 115 | - grammarly 116 | - handbrake 117 | - istat-menus5 # force version 5 118 | - iterm2 # terminal emulator 119 | - licecap # capture as a gif 120 | - microsoft-teams 121 | - postman 122 | - pycharm-ce 123 | - sequel-pro # MySQL Client (GUI) 124 | - signal 125 | - skype 126 | - slack 127 | - spotify 128 | - sublime-text 129 | - telegram 130 | - transmission # torrent client 131 | - transmit # sftp client 132 | - tunnelblick # vpn client 133 | - visual-studio-code 134 | - vlc 135 | #- google-chrome 136 | 137 | # See `geerlingguy.mas` role documentation for usage instructions. 138 | mas_signin_dialog: yes 139 | mas_installed_apps: 140 | - { id: 441258766, name: "Magnet" } # Windows Management 141 | - { id: 1176895641, name: "Spark" } # Email Client 142 | - { id: 1039633667, name: "Irvue" } # Awesome wallpapers 143 | - { id: 409183694, name: "Keynote" } 144 | - { id: 1384080005, name: "Tweetbot" } 145 | - { id: 1289197285, name: "MindNode" } # Mind Mapping App 146 | - { id: 1295203466, name: "Microsoft Remote Desktop" } # RDP Client 147 | - { id: 784801555, name: "Microsoft OneNote" } 148 | - { id: 918207447, name: "Annotate" } # Annotate Screenshots 149 | 150 | mas_upgrade_all_apps: yes 151 | 152 | osx_script: "~/.osx --no-restart" 153 | 154 | # Dock 155 | dockitems_disabled: 156 | - Calendar 157 | - Contacts 158 | - FaceTime 159 | - iBooks 160 | - iTunes 161 | - Keynote 162 | - Launchpad 163 | - Mail 164 | - Maps 165 | - Messages 166 | - Notes 167 | - Numbers 168 | - Pages 169 | - Photos 170 | - Reminders 171 | - Safari 172 | - Siri 173 | - Terminal 174 | 175 | dockitems_enabled: 176 | - name: Google Chrome 177 | path: "/Applications/Google Chrome.app" 178 | pos: 1 179 | - name: Firefox 180 | path: "/Applications/Firefox.app" 181 | pos: 2 182 | - name: Tweetbot 183 | path: "/Applications/Tweetbot.app" 184 | pos: 3 185 | - name: Spark 186 | path: "/Applications/Spark.app" 187 | pos: 4 188 | - name: Slack 189 | path: "/Applications/Slack.app" 190 | pos: 5 191 | - name: Microsoft Teams 192 | path: "/Applications/Microsoft Teams.app" 193 | pos: 6 194 | - name: iTerm 195 | path: "/Applications/iTerm.app" 196 | pos: 7 197 | - name: Sublime Text 198 | path: "/Applications/Sublime Text.app" 199 | pos: 8 200 | - name: Microsoft OneNote 201 | path: "/Applications/Microsoft OneNote.app" 202 | pos: 9 203 | - name: System Preferences 204 | path: "/Applications/System Preferences.app" 205 | pos: 10 206 | - name: Image Capture 207 | path: "/Applications/Image Capture.app" 208 | pos: 11 209 | - name: Spotify 210 | path: "/Applications/Spotify.app" 211 | pos: 12 212 | - name: Calculator 213 | path: "/Applications/Calculator.app" 214 | pos: 13 215 | - name: Dictionary 216 | path: "/Applications/Dictionary.app" 217 | pos: 14 218 | - name: Franz 219 | path: "/Applications/Franz.app" 220 | pos: 15 221 | - name: Enpass 222 | path: "/Applications/Enpass.app" 223 | pos: 16 224 | - name: Skype 225 | path: "/Applications/Skype.app" 226 | pos: 17 227 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------