[
  {
    "path": ".gitignore",
    "content": "*.retry\n**/dependencies/*\n\n# Created by https://www.gitignore.io\n\n### Vagrant ###\n.vagrant/\n\n### PyCharm ###\n# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm\n\n*.iml\n\n## Directory-based project format:\n.idea/\n# if you remove the above rule, at least ignore the following:\n\n# User-specific stuff:\n# .idea/workspace.xml\n# .idea/tasks.xml\n# .idea/dictionaries\n\n# Sensitive or high-churn files:\n# .idea/dataSources.ids\n# .idea/dataSources.xml\n# .idea/sqlDataSources.xml\n# .idea/dynamic.xml\n# .idea/uiDesigner.xml\n\n# Gradle:\n# .idea/gradle.xml\n# .idea/libraries\n\n# Mongo Explorer plugin:\n# .idea/mongoSettings.xml\n\n## File-based project format:\n*.ipr\n*.iws\n\n## Plugin-specific files:\n\n# IntelliJ\nout/\n\n# mpeltonen/sbt-idea plugin\n.idea_modules/\n\n# JIRA plugin\natlassian-ide-plugin.xml\n\n# Crashlytics plugin (for Android Studio and IntelliJ)\ncom_crashlytics_export_strings.xml\ncrashlytics.properties\ncrashlytics-build.properties\n\n\n### Python ###\n# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n\n# C extensions\n*.so\n\n# Distribution / packaging\n.Python\nenv/\nbuild/\ndevelop-eggs/\ndist/\ndownloads/\neggs/\nlib/\nlib64/\nparts/\nsdist/\nvar/\n*.egg-info/\n.installed.cfg\n*.egg\n\n# PyInstaller\n#  Usually these files are written by a python script from a template\n#  before PyInstaller builds the exe, so as to inject date/other infos into it.\n*.manifest\n*.spec\n\n# Installer logs\npip-log.txt\npip-delete-this-directory.txt\n\n# Unit test / coverage reports\nhtmlcov/\n.tox/\n.coverage\n.cache\nnosetests.xml\ncoverage.xml\n\n# Translations\n*.mo\n*.pot\n\n# Django stuff:\n*.log\n\n# Sphinx documentation\ndocs/_build/\n\n# PyBuilder\ntarget/\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: python\nsudo: yes\n\nmatrix:\n  include:\n    - python: 3.6\n      env: TOXENV=py36-ansible28\n    - python: 3.6\n      env: TOXENV=py36-ansible27\n    - python: 3.6\n      env: TOXENV=py36-ansible26\n    - python: 3.6\n      env: TOXENV=py36-ansible25\n    - python: 2.7\n      env: TOXENV=py27-ansible24\n    - python: 2.7\n      env: TOXENV=py27-ansible23\n    - python: 2.7\n      env: TOXENV=py27-ansible22\n    - python: 2.7\n      env: TOXENV=py27-ansible21\n    - python: 2.7\n      env: TOXENV=py27-ansible20\n\ninstall:\n  - pip install tox\n\nscript:\n  - tox\n\nnotifications:\n    webhooks: https://galaxy.ansible.com/api/v1/notifications/\n\nbefore_cache:\n  - rm -f ${HOME}/.cache/pip/log/debug.log\n\ncache:\n  directories:\n    - ${HOME}/.cache/pip\n"
  },
  {
    "path": ".yamllint.yml",
    "content": "---\n# Based on ansible-lint config\nextends: default\n\nrules:\n  braces: {max-spaces-inside: 1, level: error}\n  brackets: {max-spaces-inside: 1, level: error}\n  colons: {max-spaces-after: -1, level: error}\n  commas: {max-spaces-after: -1, level: error}\n  comments: disable\n  comments-indentation: disable\n  document-start: disable\n  empty-lines: {max: 3, level: error}\n  hyphens: {level: error}\n  indentation: disable\n  key-duplicates: enable\n  line-length: disable\n  new-line-at-end-of-file: disable\n  new-lines: {type: unix}\n  trailing-spaces: disable\n  truthy: disable\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright (c) 2014, ansiblebit\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n* Neither the name of ansiblebit nor the names of its\n  contributors may be used to endorse or promote products derived from\n  this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n"
  },
  {
    "path": "README.md",
    "content": "# ansiblebit.oracle-java\n\n[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg?style=flat)](https://raw.githubusercontent.com/ansiblebit/oracle-java/master/LICENSE)\n[![Build Status](https://travis-ci.org/ansiblebit/oracle-java.svg?branch=master)](https://travis-ci.org/ansiblebit/oracle-java)\n\n[![Platform](http://img.shields.io/badge/platform-centos-932279.svg?style=flat)](CentOS)\n[![Platform](http://img.shields.io/badge/platform-debian-a80030.svg?style=flat)](Debian)\n[![Platform](http://img.shields.io/badge/platform-redhat-cc0000.svg?style=flat)](RedHat)\n[![Platform](http://img.shields.io/badge/platform-ubuntu-dd4814.svg?style=flat)](Ubuntu)\n\n[![Project Stats](https://www.openhub.net/p/ansiblebit-oracle-java/widgets/project_thin_badge.gif)](https://www.openhub.net/p/ansiblebit-oracle-java/)\n\nAn [Ansible](http://www.ansible.com) role to setup Oracle Java Development Kit. \n\nDISCLAIMER: usage of any version of this role implies you have accepted the\n[Oracle Binary Code License Agreement for Java SE](http://www.oracle.com/technetwork/java/javase/terms/license/index.html).\n\n## Tests\n\n| Family | Distribution | Version | Test Status |\n|:-:|:-:|:-:|:-:|\n| Debian | Debian  | Jessie    | [![x86_64](http://img.shields.io/badge/x86_64-passed-006400.svg?style=flat)](x) |\n| Debian | Debian  | Stretch   | [![x86_64](http://img.shields.io/badge/x86_64-passed-006400.svg?style=flat)](x) |\n| Debian | Ubuntu  | Precise   | [![x86_64](http://img.shields.io/badge/x86_64-passed-006400.svg?style=flat)](x) |\n| Debian | Ubuntu  | Yakkety   | [![x86_64](http://img.shields.io/badge/x86_64-passed-006400.svg?style=flat)](x) |\n| Debian | Ubuntu  | Xenial    | [![x86_64](http://img.shields.io/badge/x86_64-passed-006400.svg?style=flat)](x) |\n| Debian | Ubuntu  | Trusty    | [![x86_64](http://img.shields.io/badge/x86_64-passed-006400.svg?style=flat)](x) |\n| Debian | Ubuntu  | Vivid     | [![x86_64](http://img.shields.io/badge/x86_64-passed-006400.svg?style=flat)](x) |\n| Debian | Ubuntu  | Wily      | [![x86_64](http://img.shields.io/badge/x86_64-passed-006400.svg?style=flat)](x) |\n| Debian | Ubuntu  | Artful    | [![x86_64](http://img.shields.io/badge/x86_64-passed-006400.svg?style=flat)](x) |\n| Debian | Ubuntu  | Bionic    | [![x86_64](http://img.shields.io/badge/x86_64-passed-006400.svg?style=flat)](x) |\n| Debian | Ubuntu  | Cosmic    | [![x86_64](http://img.shields.io/badge/x86_64-passed-006400.svg?style=flat)](x) |\n| RedHat | Centos  | 7         | [![x86_64](http://img.shields.io/badge/x86_64-passed-006400.svg?style=flat)](x) |\n\n## Requirements\n\n- ansible >= 2.x\n\n## Facts\n\n- **oracle_java_installed**: fact set by this role that contains a flag that indicates if Java is installed on the host.\n- **oracle_java_version_installed**: fact set by this role that contains the string of the Java version installed in the system.\n\n## Role Variables\n\n- **debug**: flag to make role more verbose.\n- **oracle_java_set_as_default**: flag to indicate if this play should set Java as default (default: `yes`).\n- **oracle_java_use_defaults**: flag to indicate you want to use defaults set in the `defaults` directory (default: `yes`).\n  **WARNING**. setting this to `no` will require the user to pass all of the distribution variables.\n  See `* | Java 11` examples in the _Playbooks_ section.\n\n### Debian\n\n**WARNING** to override **any** of the following variables (even if it's only one),\nyou'll need to set `oracle_java_use_defaults: no` and override **all** of their values since\nOS family defaults will no longer be loaded.\nSee `debian | Java 11` example in the _Playbooks_ section.\n\n- **oracle_java_apt_repository**: Personal Package Archive (PPA) from where to install Java.\n- **oracle_java_apt_repository_key**: PPA repository key.\n- **oracle_java_cache_valid_time**: the amount of time in seconds the apt cache is valid.\n- **oracle_java_deb_package**: name of debian package.\n- **oracle_java_debconf_package_default**: name of debconf package to set default.\n- **oracle_java_home**: the location of the Java home directory.\n- **oracle_java_state**:** the package state (see Ansible apt module for more information).\n\n### Debian/Ubuntu\n\n**WARNING** to override **any** of the following variables (even if it's only one),\nyou'll need to set `oracle_java_use_defaults: no` and override **all** of their values since\nOS family defaults will no longer be loaded.\nSee `debian | ubuntu | Java 11` example in the _Playbooks_ section.\n\n- **oracle_java_apt_repository**: Personal Package Archive (PPA) from where to install Java.\n- **oracle_java_cache_valid_time**: the amount of time in seconds the apt cache is valid.\n- **oracle_java_deb_package**: name of debian package.\n- **oracle_java_debconf_package_default**: name of debconf package to set default.\n- **oracle_java_home**: the location of the Java home directory.\n- **oracle_java_license_version**: which Oracle license version you will be accepting.\n- **oracle_java_state**:** the package state (see Ansible apt module for more information).\n\n### Redhat-only\n\n**WARNING** to override **any** of the following variables (even if it's only one),\nyou'll need to set `oracle_java_use_defaults: no` and override **all** of their values since\nOS family defaults will no longer be loaded.\nSee `redhat | centos 7 | Java 11` example in the _Playbooks_ section.\n\n- **oracle_java_dir_source**: directory where to store the RPM files.\n- **oracle_java_download_timeout**: download timeout, in seconds.\n- **oracle_java_home**: the location of the Java home directory.\n- **oracle_java_rpm_filename**: file name used for the download destination.\n- **oracle_java_rpm_url**: where to download the rpm from.\n- **oracle_java_rpm_validate_certs**: flag to indicate if you want SSL certificate validation.\n- **oracle_java_version_string**: the Java version string to verify installation against.\n\n## Playbooks\n\n```yaml\n# generic\n- hosts: servers\n  roles:\n    - role: ansiblebit.oracle-java\n\n# debian | Java 12\n- hosts: servers\n  roles:\n    - role: ansiblebit.oracle-java\n\n# debian | Java 11\n- hosts: servers\n  roles:\n    - role: ansiblebit.oracle-java\n      oracle_java_deb_package: 'oracle-java11-installer'\n      oracle_java_debconf_package_default: 'oracle-java11-set-default'\n      oracle_java_home: \"/usr/lib/jvm/java-11-oracle\"\n\n## explicitely passing default parameters\n- hosts: servers\n  roles:\n    - role: ansiblebit.oracle-java\n\n# debian | ubuntu | Java 12\n- hosts: servers\n  roles:\n    - role: ansiblebit.oracle-java\n\n# debian | ubuntu | Java 11\n- hosts: servers\n  roles:\n    - role: ansiblebit.oracle-java\n      oracle_java_deb_package: 'oracle-java11-installer'\n      oracle_java_debconf_package_default: 'oracle-java11-set-default'\n      oracle_java_home: \"/usr/lib/jvm/java-11-oracle\"\n\n# redhat | centos 7 | Java 12\n- hosts: servers\n  roles:\n    - role: ansiblebit.oracle-java\n\n# redhat | centos 7 | Java 11\n- hosts: servers\n  roles:\n    - role: ansiblebit.oracle-java\n      oracle_java_use_defaults: no\n      oracle_java_dir_source: '/usr/local/src'\n      oracle_java_download_timeout: 60\n      oracle_java_rpm_filename: 'jdk-11.0.3_linux-x64_bin.rpm'\n      oracle_java_home: '/usr/java/default'\n      oracle_java_os_supported: yes\n      oracle_java_rpm_url: 'https://download.oracle.com/otn/java/jdk/11.0.3+12/37f5e150db5247ab9333b11c1dddcd30/jdk-11.0.3_linux-x64_bin.rpm'\n      oracle_java_rpm_validate_certs: yes\n      oracle_java_set_as_default: no\n      oracle_java_version_string: 11.0.3\n```\n\nUse `--skip-tags=debug` if you want to suppress debug information.\n\n```bash\n## Test\n\n```bash\ntox -e py27-ansible26 -- --box centos7-64.vagrant.dev\n\ntox -e py27-ansible26 -- --box bionic64.vagrant.dev\n\n# manual\nsource .tox/py27-ansible26/bin/activate\ncd tests\nvagrant up bionic64.vagrant.dev\n\nbash test_idempotence.sh \\\n  --box bionic64.vagrant.dev \\\n  --inventory .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory\n\n## look at idempotence test logs\nless log/bionic64.vagrant.dev_idempotence_py27-ansible26.log\n\n## debug\nvagrant ssh bionic64.vagrant.dev\n\nbash test_checkmode.sh \\\n  --box bionic64.vagrant.dev \\\n  --inventory .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory\n\n## look at checkmode test logs\nless log/bionic64.vagrant.dev_checkmode_py27-ansible26.log\n\nvagrant destroy bionic64.vagrant.dev\n```\n\n## Links\n\n- [launchpad > Linux Uprising > Oracle Java](https://launchpad.net/~linuxuprising/+archive/ubuntu/java)\n"
  },
  {
    "path": "defaults/darwin-macosx.yml",
    "content": "---\n# file: oracle-java/defaults/darwin-macosx.yml\n#\n# Default variables for OSX-based Darwin distributions.\n#\n\noracle_java_dir_source: \"{{ ansible_env.HOME }}/Downloads\"\noracle_java_dmg_filename: \"\"\noracle_java_dmg_url: \"/{{ oracle_java_dmg_filename }}\"\n"
  },
  {
    "path": "defaults/debian-ubuntu.yml",
    "content": "---\n# file: oracle-java/defaults/debian-ubuntu.yml\n#\n# Default variables for Ubuntu Linux distributions.\n#\n\noracle_java_apt_repository: 'ppa:linuxuprising/java'\noracle_java_cache_valid_time: 3600\noracle_java_deb_package: 'oracle-java12-installer'\noracle_java_debconf_package_default: 'oracle-java12-set-default'\noracle_java_home: \"/usr/lib/jvm/java-12-oracle\"\noracle_java_license_version: 'shared/accepted-oracle-license-v1-2'\noracle_java_state: latest\n"
  },
  {
    "path": "defaults/debian.yml",
    "content": "---\n# file: oracle-java/defaults/debian.yml\n#\n# Default variables for Debian-based Linux distributions.\n#\n\noracle_java_apt_repository: 'deb http://ppa.launchpad.net/linuxuprising/java/ubuntu bionic main'\noracle_java_apt_repository_key: 'EA8CACC073C3DB2A'\noracle_java_cache_valid_time: 3600\noracle_java_deb_package: 'oracle-java12-installer'\noracle_java_debconf_package_default: 'oracle-java12-set-default'\noracle_java_home: \"/usr/lib/jvm/java-12-oracle\"\noracle_java_license_version: 'shared/accepted-oracle-license-v1-2'\noracle_java_state: latest\n"
  },
  {
    "path": "defaults/main.yml",
    "content": "---\n# file: oracle-java/defaults/main.yml\n#\n# defaults file\n#\n\noracle_java_set_as_default: yes\noracle_java_use_defaults: yes\n"
  },
  {
    "path": "defaults/redhat.yml",
    "content": "---\n# file: oracle-java/defaults/redhat.yml\n#\n# Default variables for Redhat-based Linux distributions.\n#\n\noracle_java_dir_source: '/usr/local/src'\noracle_java_download_timeout: 60\noracle_java_rpm_filename: 'jdk-12.0.1_linux-x64_bin.rpm'\noracle_java_home: '/usr/java/default'\noracle_java_rpm_url: 'https://download.oracle.com/otn-pub/java/jdk/12.0.1+12/69cfe15208a647278a19ef0990eea691/jdk-12.0.1_linux-x64_bin.rpm'\noracle_java_rpm_validate_certs: yes\noracle_java_version: 12\noracle_java_version_string: 12.0.1\n"
  },
  {
    "path": "handlers/main.yml",
    "content": "---\n# file: oracle-java/handlers/main.yml\n#\n# Handlers file.\n#\n"
  },
  {
    "path": "meta/main.yml",
    "content": "---\n# file: oracle-java/meta/main.yml\n#\n# meta file\n#\n\ngalaxy_info:\n  author: Pedro Salgado\n  description: Role to install Oracle Java.\n  company: ansiblebit.org\n  license: BSD\n  min_ansible_version: 2.0\n  platforms:\n    - name: CentOS\n      versions:\n        - any\n        - 7\n        - 6\n    - name: Debian\n      versions:\n        - jessie\n        - wheezy\n    - name: RedHat\n      versions:\n        - any\n        - 7\n        - 6\n    - name: Ubuntu\n      versions:\n        - cosmic\n        - bionic\n        - xenial\n        - vivid\n        - trusty\n        - precise\n  galaxy_tags:\n    - development\n    - java\n    - system\n"
  },
  {
    "path": "requirements.yml",
    "content": ""
  },
  {
    "path": "tasks/check_environment.yml",
    "content": "---\n# file: oracle-java/tasks/check_environment.yml\n#\n# task to set host facts:\n#   - Java is installed?\n#   - which Java version is installed?\n#\n\n- name: determine if Java is already installed\n  command: which java\n  register: oracle_java_task_installed\n  changed_when: oracle_java_task_installed.rc != 0\n  failed_when: no\n# oracle_java_installed.rc == 0 : installed\n# oracle_java_installed.rc == 1 : not installed\n\n- name: set fact oracle_java_installed\n  set_fact:\n    oracle_java_installed={{ not oracle_java_task_installed.changed }}\n\n- name: determine which Java version is installed\n  shell: |\n    set -o pipefail |\n    java -version 2>&1 |\n    head -n 1 |\n    awk '{ print $3 }' |\n    awk -F '\"' '{ print $2 }'\n  register: oracle_java_task_version\n  when: oracle_java_installed\n  changed_when: False\n\n- name: set fact oracle_java_installed_version\n  set_fact:\n    oracle_java_version_installed=\"{{ oracle_java_task_version.stdout }}\"\n  when: oracle_java_task_version is defined and oracle_java_task_version.stdout is defined\n  changed_when: False\n\n- debug:\n    var=\"{{ item }}\"\n  when: item is defined and debug | default(false)\n  with_items:\n    - oracle_java_installed\n    - oracle_java_task_installed\n    - oracle_java_task_version\n    - oracle_java_version_installed\n  tags: [ debug ]\n"
  },
  {
    "path": "tasks/darwin/macosx.yml",
    "content": "---\n# file: oracle-java/tasks/darwin/macosx.yml\n#\n# Task file to install Oracle Java Development Kit in a system with a OSX based Darwin distribution.\n#\n\n- name: download DMG file\n  get_url:\n    headers:\n      Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F\n      oraclelicense: accept-securebackup-cookie\n    dest: \"{{ oracle_java_dir_source }}/{{ oracle_java_dmg_filename }}\"\n    url: \"{{ oracle_java_dmg_url }}\"\n    validate_certs: \"{{ oracle_java_dmg_validate_certs }}\"\n    timeout: \"{{ oracle_java_download_timeout }}\"\n    force: no\n  register: oracle_java_task_dmg_download\n  until: oracle_java_task_dmg_download is succeeded\n  tags:\n    - installation\n\n# - name: mount DMG image\n#   shell: echo TODO\n#   tags:\n#     - installation\n\n# - name: install JDK\n#   shell: echo TODO\n#   tags:\n#     - installation\n\n# - name: unmount DMG image\n#   shell: echo TODO\n#   tags:\n#     - installation\n\n# - name: set Java version as default\n#   shell: echo TODO\n#   when: oracle_java_set_as_default\n#   register: oracle_java_task_set_default\n#   become: yes\n\n- name: in case there were changes, check host environment again\n  include: ../check_environment.yml\n"
  },
  {
    "path": "tasks/debug.yml",
    "content": "---\n# file: oracle-java/tasks/debug.yml\n#\n# Task that prints variable debug information.\n#\n\n- debug:\n    var=\"{{ item }}\"\n  when: item is defined\n  with_items:\n    - oracle_java_cache_valid_time\n    - oracle_java_home\n    - oracle_java_installed\n    - oracle_java_apt_repository\n    - oracle_java_apt_repository_key\n    - oracle_java_license_version\n    - oracle_java_set_as_default\n    - oracle_java_state\n    - oracle_java_version_installed\n    - oracle_java_version_string\n"
  },
  {
    "path": "tasks/installation/debian/main.yml",
    "content": "---\n# file: oracle-java/tasks/installation/debian/main.yml\n#\n# Task file to install Oracle Java Development Kit in a system with a Debian based Linux distribution.\n#\n\n- name: debian | ensure the apt repository key is present\n  apt_key:\n    id=\"{{ oracle_java_apt_repository_key }}\"\n    keyserver=keyserver.ubuntu.com\n    state=present\n  when: oracle_java_apt_repository_key is defined\n  become: yes\n\n- name: debian | ensure the apt repository is present\n  apt_repository:\n    repo=\"{{ oracle_java_apt_repository }}\"\n    update_cache=yes\n    state=present\n  become: yes\n\n- name: debian | set license as accepted\n  debconf:\n    name=\"{{ oracle_java_deb_package }}\"\n    question=\"{{ oracle_java_license_version }}\"\n    value='true'\n    vtype='select'\n  become: yes\n\n- name: debian | ensure Java is installed\n  apt:\n    name=\"{{ oracle_java_deb_package }}\"\n    state={{ oracle_java_state }}\n    cache_valid_time={{ oracle_java_cache_valid_time }}\n    update_cache=yes\n  register: oracle_java_task_apt_install\n  become: yes\n\n- name: debian | set Java version as default\n  apt:\n    name=\"{{ oracle_java_debconf_package_default }}\"\n    state=present\n  register: oracle_java_task_set_default\n  when: oracle_java_set_as_default\n  become: yes\n"
  },
  {
    "path": "tasks/installation/redhat/main.yml",
    "content": "---\n# file: oracle-java/tasks/installation/redhat/main.yml\n#\n# Task file to install Oracle Java Development Kit in a system with a Redhat based Linux distribution.\n#\n\n- name: download Java RPM\n  get_url:\n    headers:\n      Cookie: \"gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie\"\n    dest: \"{{ oracle_java_dir_source }}/{{ oracle_java_rpm_filename }}\"\n    url: \"{{ oracle_java_rpm_url }}\"\n    validate_certs: \"{{ oracle_java_rpm_validate_certs }}\"\n    timeout: \"{{ oracle_java_download_timeout }}\"\n    force: no\n  register: oracle_java_task_rpm_download\n  until: oracle_java_task_rpm_download is succeeded\n  become: yes\n  when: oracle_java_version_installed is not defined or oracle_java_version_installed != oracle_java_version_string\n\n- name: install RPM\n  yum:\n    name=\"{{ oracle_java_dir_source }}/{{ oracle_java_rpm_filename }}\"\n    state=present\n  when: not oracle_java_task_rpm_download is skipped\n  become: yes\n\n- name: set Java version as default\n  alternatives:\n    name=\"{{ java.exe }}\"\n    link=\"/usr/bin/{{ java.exe }}\"\n    path=\"{{ java.path }}/{{ java.exe }}\"\n  with_items:\n    - { path: \"{{ oracle_java_home }}/bin\", exe: 'java' }\n    - { path: \"{{ oracle_java_home }}/bin\", exe: 'keytool' }\n    - { path: \"{{ oracle_java_home }}/bin\", exe: 'javac' }\n    - { path: \"{{ oracle_java_home }}/bin\", exe: 'javadoc' }\n  loop_control:\n      loop_var: java\n  become: yes\n  when: (\n          oracle_java_set_as_default and\n          oracle_java_task_rpm_download is defined and\n          oracle_java_task_rpm_download is changed\n        ) or (\n          oracle_java_set_as_default and\n          oracle_java_installed is defined and\n          oracle_java_installed and\n          oracle_java_version_installed is defined and\n          oracle_java_version_installed != oracle_java_version_string)\n  register: oracle_java_task_set_default\n"
  },
  {
    "path": "tasks/main.yml",
    "content": "---\n# file: oracle-java/tasks/main.yml\n#\n# tasks file\n#\n\n## include OS family specific variables\n\n- name: include OS family/distribution specific variables\n  include_vars: \"{{ item }}\"\n  with_first_found:\n    - \"{{ role_path }}/defaults/{{ ansible_os_family | lower }}-{{ ansible_distribution | lower }}.yml\"\n    - \"{{ role_path }}/defaults/{{ ansible_os_family | lower }}.yml\"\n  when: oracle_java_use_defaults\n  tags: [ installation ]\n\n## run\n\n- name: check host environment\n  include: check_environment.yml\n\n- include: debug.yml\n  when: debug | default(false)\n  tags: [ debug ]\n\n## include OS family/distribution specific task file\n\n- name: include OS family/distribution specific task file\n  include: \"{{ item }}\"\n  with_first_found:\n    - \"installation/{{ ansible_os_family | lower }}/{{ ansible_distribution | lower }}_{{ ansible_distribution_version | lower }}.yml\"\n    - \"installation/{{ ansible_os_family | lower }}/{{ ansible_distribution | lower }}.yml\"\n    - \"installation/{{ ansible_os_family | lower }}/main.yml\"\n  tags: [ installation ]\n\n- name: check host environment\n  include: check_environment.yml\n"
  },
  {
    "path": "tests/Vagrantfile",
    "content": "#!/usr/bin/env ruby\n\nrequire 'yaml'\n\nPLAYBOOK = 'test.yml'\nCONFIGURATION_FILE = 'boxes.yml'\nROLE_NAME = \"#{File.expand_path(\"..\").split(\"/\")[-1]}\"\n\nVagrant.configure('2') do |config|\n\n  # overcome 'stdin: is not a tty' errors when trying to provision on vivid64\n  config.ssh.pty = true\n  config.ssh.shell = 'bash'\n\n  # puts \"[DEBUG] loading box settings from #{CONFIGURATION_FILE}...\"\n  vagrant_environment = YAML.load_file(File.expand_path(CONFIGURATION_FILE, File.dirname(__FILE__)))\n\n  vagrant_environment['vagrant'].each do |box_name, box_settings|\n    if not box_settings['enabled']\n        # puts \"[DEBUG] #{box_name} is not enabled. skipping...\"\n        next\n    end\n\n    # puts \"[DEBUG] applying #{box_name} settings...\"\n    config.vm.define box_name do |host|\n\n      host.vm.box = box_settings['box'] unless not box_settings.key? 'box'\n      host.vm.box_version = box_settings['box_version'] unless not box_settings.key? 'box_version'\n\n      host.vm.network box_settings['network']['name'], ip: box_settings['network']['ip'] unless box_settings.key? 'network'\n      host.vm.synced_folder '.', '/vagrant', disabled: true\n\n      # puts \"[DEBUG] applying virtualbox settings for #{box_name} box...\"\n      customize_args = [ \"modifyvm\", :id ]\n      vagrant_environment['provider']['virtualbox'].collect { |k, v| customize_args |= [\"--#{k}\", v.to_s] }\n      host.vm.provider 'virtualbox' do |vb|\n        vb.name = \"#{ROLE_NAME}_#{box_name}\"\n        vb.customize customize_args\n      end\n\n      # puts \"[DEBUG] provision using ansible vagrant playbook...\"\n      host.vm.provision 'ansible' do |ansible|\n\n        ansible.host_vars = {\n            'xenial64.vagrant.dev' => {\n                'ansible_python_interpreter' => '/usr/bin/python2.7',\n                'playbook_python2' => true\n            },\n            'yakkety64.vagrant.dev' => {\n                'ansible_python_interpreter' => '/usr/bin/python2.7',\n                'playbook_python2' => true\n            },\n            'artful64.vagrant.dev' => {\n                'ansible_python_interpreter' => '/usr/bin/python2.7',\n                'playbook_python2' => true\n            },\n            'bionic64.vagrant.dev' => {\n                'ansible_python_interpreter' => '/usr/bin/python2.7',\n                'playbook_python2' => true\n            },\n            'cosmic64.vagrant.dev' => {\n                'ansible_python_interpreter' => '/usr/bin/python2.7',\n                'playbook_python2' => true\n            },\n        }\n\n        ansible.playbook = PLAYBOOK\n        ansible.verbose = 'v'\n        ansible.skip_tags = 'test'\n        ansible.extra_vars = {\n            'env': 'vagrant',\n            'vagrant_box': \"#{box_name}\"\n        }\n      end\n    end\n  end\nend\n\n"
  },
  {
    "path": "tests/ansible.cfg",
    "content": "[defaults]\nansible_managed = Ansible managed file, do not edit directly\ncallback_plugins = plugins/callback\n\nhost_key_checking = False\n\nprivate_key_file = ~/.vagrant.d/insecure_private_key\n\nroles_path = ../../:../:dependencies\n\n"
  },
  {
    "path": "tests/boxes.yml",
    "content": "---\n# file: oracle-java/tests/boxes.yml\n#\n\nprovider:\n  virtualbox:\n    memory: 1024\n    cpus: 1\n\n\nvagrant:\n\n\n  # CentOS\n\n  centos7-64.vagrant.dev:\n    enabled: true\n    box: centos/7\n    network:\n      name: private_network\n      ip: 192.168.121.3\n\n\n  # Debian\n\n  jessie64.vagrant.dev:\n    enabled: true\n    box: debian/jessie64\n    network:\n      name: private_network\n      ip: 192.168.122.1\n\n  stretch64.vagrant.dev:\n    enabled: true\n    box: debian/stretch64\n    network:\n      name: private_network\n      ip: 192.168.122.3\n\n  # Ubuntu\n\n  precise64.vagrant.dev:\n    enabled: true\n    box: ubuntu/precise64\n    network:\n      name: private_network\n      ip: 192.168.124.2\n\n  trusty64.vagrant.dev:\n    enabled: true\n    box: ubuntu/trusty64\n    network:\n      name: private_network\n      ip: 192.168.124.4\n\n  vivid64.vagrant.dev:\n    enabled: true\n    box: ubuntu/vivid64\n    network:\n      name: private_network\n      ip: 192.168.124.6\n\n  wily64.vagrant.dev:\n    enabled: true\n    box: ubuntu/vivid64\n    network:\n      name: private_network\n      ip: 192.168.124.8\n\n  xenial64.vagrant.dev:\n    enabled: true\n    box: ubuntu/xenial64\n    network:\n      name: private_network\n      ip: 192.168.124.10\n\n  yakkety64.vagrant.dev:\n    enabled: true\n    box: ubuntu/yakkety64\n    network:\n      name: private_network\n      ip: 192.168.124.12\n\n  artful64.vagrant.dev:\n    enabled: true\n    box: ubuntu/artful64\n    network:\n      name: private_network\n      ip: 192.168.124.10\n\n  bionic64.vagrant.dev:\n    enabled: true\n    box: ubuntu/bionic64\n    network:\n      name: private_network\n      ip: 192.168.124.11\n\n  cosmic64.vagrant.dev:\n    enabled: true\n    box: ubuntu/cosmic64\n    network:\n      name: private_network\n      ip: 192.168.124.12\n"
  },
  {
    "path": "tests/log/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/plugins/callback/idempotence.py",
    "content": "# -*- coding: utf-8 -*-\n\nfrom __future__ import (absolute_import, print_function)\n\nimport sys\nimport os\n\nfrom ansible import constants as C\nfrom ansible.constants import mk_boolean\n\ntry:\n    from ansible.plugins.callback import CallbackBase\n    parent = CallbackBase\nexcept ImportError:\n    parent = object\n\n\nVAR_IDEMPOTENCE = u'IDEMPOTENCE'\n\n\nclass CallbackModule(parent):\n    \"\"\"\n    This callback module performs the idempotency test whenever the 'idempotency' variable is set to True.\n    \"\"\"\n    CALLBACK_VERSION = 2.0\n    CALLBACK_NAME = 'idempotency'\n\n    def __init__(self):\n        self.playbook = None\n        self.enabled = mk_boolean(os.getenv(VAR_IDEMPOTENCE, 'no'))\n\n        super(CallbackModule, self).__init__()\n\n    def playbook_on_stats(self, stats):\n\n        if self.enabled:\n            if len(stats.dark) > 0:\n                self._display.warning('idempotency test failed: unreachable=%s > 0' % stats.dark)\n                sys.exit(os.EX_SOFTWARE)\n            if len(stats.changed) > 0:\n                self._display.warning('idempotency test failed: changed=%s > 0' % stats.changed)\n                sys.exit(os.EX_SOFTWARE)\n            if len(stats.failures) > 0:\n                self._display.warning('idempotency test failed: failures=%s > 0' % stats.failures)\n                sys.exit(os.EX_SOFTWARE)\n\n    def v2_playbook_on_stats(self, stats):\n        \"\"\"Verify that playbook ran without any changes or failures.\"\"\"\n        self.playbook_on_stats(stats)\n\n"
  },
  {
    "path": "tests/requirements.txt",
    "content": "ansiblebit.launchpad-ppa-webupd8\n"
  },
  {
    "path": "tests/setup.sh",
    "content": "#!/usr/bin/env bash\n# #################\n#\n# Bash script to setup the test environment.\n#\n# version: 1.0\n#\n# usage:\n#\n#   setup.sh\n#\n# example:\n#\n#   bash setup.sh\n#\n# changelog:\n#\n#   v1.0 :  10 June 2016\n#     - initial version\n#\n# author(s):\n#   - Pedro Salgado <steenzout@ymail.com>\n#\n# #################\n\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n\ntest -s ${DIR}/../requirements.yml \\\n    && ansible-galaxy install \\\n        --force \\\n        -r ${DIR}/../requirements.yml \\\n        --roles-path=${DIR}/dependencies \\\n    || true\n"
  },
  {
    "path": "tests/tasks/main.yml",
    "content": "---\n# file: oracle-java/tests/tasks/main.yml\n#\n# Test tasks to verify role execution.\n#\n\n- name: is oracle_java_installed fact set?\n  fail:\n    msg=\"oracle_java_installed fact is not defined!\"\n  when: not oracle_java_installed is defined\n\n- name: is oracle_java_installed fact true?\n  fail:\n    msg=\"oracle_java_installed fact is false!\"\n  when: not oracle_java_installed\n\n- name: is oracle_java_version_installed fact set?\n  fail:\n    msg=\"oracle_java_installed fact is not defined!\"\n  when: not oracle_java_version_installed is defined\n\n- name: is oracle_java_version_installed value correct?\n  fail:\n    msg=\"oracle_java_version_installed value is {{ oracle_java_version_installed }} instead of {{ expected_java_version }}!\"\n  when: oracle_java_version_installed != expected_java_version\n\n- name: register result_java_version with host installed Java version\n  shell: java -version 2>&1 | head -n 1 | awk '{ print $3 }' | awk -F '\"' '{ print $2 }'\n  register: result_java_version\n  changed_when: no\n\n- name: is installed Java version on host correct?\n  fail:\n    msg=\"java -version output was {{ result_java_version.stdout }} instead of {{ expected_java_version }}\"\n  when: result_java_version.stdout != expected_java_version\n\n- name: ensure keytool and javadoc are present\n  shell: \"test -h /usr/bin/{{ item }}\"\n  changed_when: no\n  with_items:\n    - keytool\n    - java\n    - javadoc\n"
  },
  {
    "path": "tests/test.yml",
    "content": "---\n# file: oracle-java/tests/test.yml\n\n- name: setup python2\n  hosts: \"{{ vagrant_box }}\"\n  gather_facts: no\n\n  tasks:\n    - raw: sudo apt-get update -qq && sudo apt-get install -qq python2.7\n      when: playbook_python2 is defined and\n            playbook_python2\n      changed_when: false\n\n- name: setup stretch\n  hosts: \"{{ vagrant_box }}\"\n\n  tasks:\n    - apt:\n        name=software-properties-common\n        state=present\n        become=yes\n      when: ansible_distribution | lower == 'stretch'\n\n- name: tests play\n  hosts: all\n  gather_facts: yes\n  vars:\n    debug: yes\n    test_expected_java_version: '12.0.1'\n\n  roles:\n    - role: oracle-java\n\n    - role: tests\n      expected_java_version: \"{{ test_expected_java_version }}\"\n      tags: [ test ]\n"
  },
  {
    "path": "tests/test_checkmode.sh",
    "content": "#!/usr/bin/env bash\n# #################\n#\n# Bash script to run check mode tests.\n#\n# version: 1.5\n#\n# usage:\n#\n#   test_checkmode [options]\n#\n# options:\n#\n#   --box       The name of the Vagrant box or host name\n#   --env       The name of the test environment\n#   --inventory The Ansible inventory in the form of a file or string \"host,\"\n#   --playbook  The path to the Ansible test playbook\n#\n# example:\n#\n#   # on localhost\n#   bash test_checkmode.sh\n#\n#   # on a Vagrant box\n#   bash test_checkmode.sh \\\n#       --box precise64.vagrant.dev \\\n#       --inventory .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory\n#\n#\n# changelog:\n#\n#   v1.5 :  8 Mar 2016\n#     - pass vagrant_box variable to playbook\n#     - default inventory changed from localhost to match what Vagrant provisioner generates\n#   v1.4 : 10 Jul 2015\n#     - added extra variables to force running idempotence tests on vagrant\n#   v1.2\n#     - added env option\n#\n# author(s):\n#   - Pedro Salgado <steenzout@ymail.com>\n#\n# #################\n\n\n# GREEN : SGR code to set text color (foreground) to green.\nGREEN='\\033[0;32m'\n# RED : SGR code to set text color (foreground) to red.\nRED='\\033[0;31m'\n# SGR code to set text color (foreground) to no color.\nNC='\\033[0m'\n# The idempotence pass criteria.\nPASS_CRITERIA=\"changed=0.* unreachable=0.* failed=0\"\n\n# the name of the virtualenv\nVIRTUALENV_NAME=$(which python | awk -F / 'NF && NF-2 { print ( $(NF-2) ) }')\n\n\nwhile [[ $# > 1 ]]\ndo\nkey=\"$1\"\n\n    case $key in\n\n        --box)\n        # the name of the Vagrant box or host name\n        BOX=\"$2\"\n        shift;;\n\n        --env)\n        # the test environment\n        ENV=\"$2\"\n        shift;;\n\n        --inventory)\n        # the Ansible inventory in the form of a file or string \"host,\"\n        INVENTORY=\"$2\"\n        shift;;\n\n        --playbook)\n        # the path to the Ansible test playbook\n        PLAYBOOK=\"$2\"\n        shift;;\n\n        *)\n        # unknown option\n        ;;\n\n    esac\n    shift\ndone\n\n# the name of the Vagrant box or host name\nBOX=${BOX:-localhost}\n# the Ansible inventory\nINVENTORY=${INVENTORY:-'.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory'}\n# the path to the Ansible test playbook\nPLAYBOOK=${PLAYBOOK:-test.yml}\n# the logfile to hold the output of the playbook run\nLOGFILE=\"log/${BOX}_checkmode_${VIRTUALENV_NAME}.log\"\n\nEXTRA_ARGS=''\nif [ $BOX == \"localhost\" ]; then\n    INVENTORY='localhost,'\n    EXTRA_ARGS=\"--connection=local -e env=${ENV} -e vagrant_box=localhost --skip-tags=test\"\nelse\n    EXTRA_ARGS=\"--user vagrant -e env=vagrant -e vagrant_box=${BOX} --skip-tags=test\"\nfi\n\necho \"[INFO] ${BOX} ${VIRTUALENV_NAME} running checkmode test...\"\nansible-playbook -vvvv --check --diff -i ${INVENTORY} --limit ${BOX}, ${EXTRA_ARGS} ${PLAYBOOK} 2>&1 | \\\n    tee ${LOGFILE} | \\\n    grep \"${BOX}\" | grep -q \"${PASS_CRITERIA}\" && \\\n    echo -ne \"[TEST] ${BOX} ${VIRTUALENV_NAME} checkmode : ${GREEN}PASS${NC}\\n\" || ( \\\n        cat ${LOGFILE} &&\n        echo -ne \"[TEST] ${BOX} ${VIRTUALENV_NAME} checkmode : ${RED}FAILED${NC} ${PASS_CRITERIA}\\n\" && \\\n        exit 1)\n\n"
  },
  {
    "path": "tests/test_idempotence.sh",
    "content": "#!/usr/bin/env bash\n# #################\n#\n# Bash script to run idempotence tests.\n#\n# version: 1.5\n#\n# usage:\n#\n#   test_idempotence [options]\n#\n# options:\n#\n#   --box       The name of the Vagrant box or host name\n#   --env       The name of the test environment\n#   --inventory The Ansible inventory in the form of a file or string \"host,\"\n#   --playbook  The path to the Ansible test playbook\n#\n# example:\n#\n#   # on localhost\n#   bash test_idempotence.sh\n#\n#   # on a Vagrant box\n#   bash test_idempotence.sh \\\n#       --box precise64.vagrant.dev \\\n#       --inventory .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory\n#\n#\n# changelog:\n#\n#   v1.5 :  8 Mar 2016\n#     - pass vagrant_box variable to playbook\n#     - default inventory changed from localhost to match what Vagrant provisioner generates\n#   v1.4 : 10 Jul 2015\n#     - added extra variables to force running idempotence tests on vagrant\n#   v1.2\n#     - added env option\n#\n# author(s):\n#   - Pedro Salgado <steenzout@ymail.com>\n#\n# #################\n\n\n# GREEN : SGR code to set text color (foreground) to green.\nGREEN='\\033[0;32m'\n# RED : SGR code to set text color (foreground) to red.\nRED='\\033[0;31m'\n# SGR code to set text color (foreground) to no color.\nNC='\\033[0m'\n# The idempotence pass criteria.\nPASS_CRITERIA=\"changed=0.* unreachable=0.* failed=0\"\n\n# the name of the virtualenv\nVIRTUALENV_NAME=$(which python | awk -F / 'NF && NF-2 { print ( $(NF-2) ) }')\n\n\nwhile [[ $# > 1 ]]\ndo\nkey=\"$1\"\n\n    case $key in\n\n        --box)\n        # the name of the Vagrant box or host name\n        BOX=\"$2\"\n        shift;;\n\n        --env)\n        # the test environment\n        ENV=\"$2\"\n        shift;;\n\n        --inventory)\n        # the Ansible inventory in the form of a file or string \"host,\"\n        INVENTORY=\"$2\"\n        shift;;\n\n        --playbook)\n        # the path to the Ansible test playbook\n        PLAYBOOK=\"$2\"\n        shift;;\n\n        *)\n        # unknown option\n        ;;\n\n    esac\n    shift\ndone\n\n# the name of the Vagrant box or host name\nBOX=${BOX:-localhost}\n# the Ansible inventory\nINVENTORY=${INVENTORY:-'.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory'}\n# the path to the Ansible test playbook\nPLAYBOOK=${PLAYBOOK:-test.yml}\n# the logfile to hold the output of the playbook run\nLOGFILE=\"log/${BOX}_idempotence_${VIRTUALENV_NAME}.log\"\n\nEXTRA_ARGS=''\nif [ $BOX == \"localhost\" ]; then\n    INVENTORY='localhost,'\n    EXTRA_ARGS=\"--connection=local -e env=${ENV} -e vagrant_box=localhost\"\nelse\n    EXTRA_ARGS=\"--user vagrant -e env=vagrant -e vagrant_box=${BOX}\"\nfi\n\necho \"[INFO] ${BOX} ${VIRTUALENV_NAME} running idempotence test...\"\nIDEMPOTENCE='yes' \\\n    ansible-playbook -vvvv -i ${INVENTORY} --limit ${BOX}, ${EXTRA_ARGS} ${PLAYBOOK} 2>&1 | \\\n    tee ${LOGFILE} | \\\n    grep \"${BOX}\" | grep -q \"${PASS_CRITERIA}\" && \\\n    echo -ne \"[TEST] ${BOX} ${VIRTUALENV_NAME} idempotence : ${GREEN}PASS${NC}\\n\" || ( \\\n        cat ${LOGFILE} &&\n        echo -ne \"[TEST] ${BOX} ${VIRTUALENV_NAME} idempotence : ${RED}FAILED${NC} ${PASS_CRITERIA}\\n\" && \\\n        exit 1)\n\n"
  },
  {
    "path": "tests/travis.sh",
    "content": "#!/usr/bin/env bash\n# #################\n#\n# Bash script to run tests in the travis-ci environment.\n#\n# version: 1.0\n#\n# usage:\n#\n#   travis.sh\n#\n# example:\n#\n#   bash travis.sh\n#\n# changelog:\n#\n#   v1.0 :  10 June 2016\n#     - initial version\n#\n# author(s):\n#   - Pedro Salgado <steenzout@ymail.com>\n#\n# #################\n\ntest $USER != 'travis' && exit 0\n\nset -e\n\nansible-playbook \\\n    -i localhost, \\\n    --connection=local test.yml \\\n    -e vagrant_box=localhost \\\n    -e env=travis \\\n    --skip-tags=test \\\n    $@ \\\n&& bash test_idempotence.sh \\\n    --env travis \\\n&& bash test_checkmode.sh \\\n    --env travis\n"
  },
  {
    "path": "tests/vagrant.sh",
    "content": "#!/usr/bin/env bash\n# #################\n#\n# Bash script to run the test suite against the Vagrant environment.\n#\n# version: 1.8\n#\n# usage:\n#\n#   # run tests against all enabled Vagrant boxes\n#   $ bash vagrant.sh\n#\n#   # run tests against a single Vagrant box\n#   $ bash vagrant.sh --box precise64.vagrant.dev\n#\n#\n# changelog:\n#\n#   v1.8 : 10 August 2016\n#     - force provisioning\n#\n#   v1.6 : 10 Jun 2016\n#     - exit if USER environment variable is travis\n#\n#   v1.4 : 10 Jul 2015\n#     - remove environment variable ANSIBLE_ASK_SUDO_PASS\n#\n# author(s):\n#   - Pedro Salgado <steenzout@ymail.com>\n#\n# #################\n\ntest $USER == 'travis' && exit 0\n\nDIR=\"$(dirname \"$0\")\"\n\ncd $DIR\n\n# the path to the Ansible inventory generated by Vagrant\nINVENTORY=${DIR}/.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory\n\n\nwhile [[ $# > 1 ]]\ndo\nkey=\"$1\"\n\n    case $key in\n\n        --box)\n        # the name of the Vagrant box to run tests against\n        BOX=\"$2\"\n        shift;;\n\n        *)\n        # unknown option\n        ;;\n\n    esac\n    shift\ndone\n\nfor VAGRANT_BOX in `grep vagrant.dev boxes.yml | sed 's/://g'`\ndo\n    if [ ! -n \"${BOX+1}\" ] || [ \"${BOX}\" = \"${VAGRANT_BOX}\" ]; then\n\n        echo \"[INFO] preparing ${VAGRANT_BOX}...\"\n        vagrant up --provision ${VAGRANT_BOX} 2> /dev/null\n        if [ $? -ne 0 ]; then\n            # box not enabled\n            continue\n        fi\n\n        bash ${DIR}/test_idempotence.sh --box ${VAGRANT_BOX} --inventory $INVENTORY\n        bash ${DIR}/test_checkmode.sh --box ${VAGRANT_BOX} --inventory $INVENTORY\n\n        echo \"[INFO] destroy ${VAGRANT_BOX}...\"\n        vagrant destroy -f ${VAGRANT_BOX}\n    fi\ndone\n"
  },
  {
    "path": "tox.ini",
    "content": "[tox]\nenvlist =\n    py{36}-ansible{28,27,26,25},py27-{24,23,22,21,20}\n\nskipsdist = True\n\n\n[testenv]\nchangedir = tests\ndeps =\n    ansible28: ansible>=2.8,<2.9\n    ansible27: ansible>=2.7,<2.8\n    ansible26: ansible>=2.6,<2.7\n    ansible25: ansible>=2.5,<2.6\n    ansible24: ansible>=2.4,<2.5\n    ansible23: ansible>=2.3,<2.4\n    ansible22: ansible>=2.2,<2.3\n    ansible21: ansible>=2.1,<2.2\n    ansible20: ansible>=2.0.0,<2.1\n    ansible-lint==4.1.0\n    yamllint==1.15.0\n\npassenv = ANSIBLE_ASK_SUDO_PASS HOME LANG LC_ALL TRAVIS USER\n\ncommands =\n    yamllint -c ../.yamllint.yml ..\n    ansible-lint --exclude .tox ..\n    bash setup.sh\n    bash travis.sh {posargs}\n    bash vagrant.sh {posargs}\n\nwhitelist_externals =\n    bash\n"
  }
]