From 02d22805e23788e73298bd32214a8db85deeb2bd Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 20 Feb 2020 14:22:22 -0600 Subject: [PATCH] Update molecule configuration to work with 3.0. --- .travis.yml | 2 +- molecule/default/molecule.yml | 13 +++------- molecule/default/playbook.yml | 46 ---------------------------------- molecule/default/yaml-lint.yml | 6 ----- 4 files changed, 4 insertions(+), 63 deletions(-) delete mode 100644 molecule/default/playbook.yml delete mode 100644 molecule/default/yaml-lint.yml diff --git a/.travis.yml b/.travis.yml index a2f0a70..0a9af7a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ env: install: # Install test dependencies. - - pip install molecule docker + - pip install molecule yamllint ansible-lint docker before_script: # Use actual Ansible Galaxy role name for the project directory. diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index b6989c4..4938579 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -4,9 +4,8 @@ dependency: driver: name: docker lint: - name: yamllint - options: - config-file: molecule/default/yaml-lint.yml + yamllint . + ansible-lint platforms: - name: instance image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest" @@ -18,13 +17,7 @@ platforms: pre_build_image: true provisioner: name: ansible - lint: - name: ansible-lint playbooks: - converge: ${MOLECULE_PLAYBOOK:-playbook.yml} + converge: ${MOLECULE_PLAYBOOK:-converge.yml} scenario: name: default -verifier: - name: testinfra - lint: - name: flake8 diff --git a/molecule/default/playbook.yml b/molecule/default/playbook.yml deleted file mode 100644 index f93c7d7..0000000 --- a/molecule/default/playbook.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- -- name: Converge - hosts: all - become: true - - vars: - # Allow swap in test environments (hard to control in some Docker envs). - kubernetes_kubelet_extra_args: "--fail-swap-on=false --cgroup-driver=cgroupfs" - docker_install_compose: false - - pre_tasks: - - name: Update apt cache. - apt: update_cache=true cache_valid_time=600 - when: ansible_os_family == 'Debian' - - - name: Ensure test dependencies are installed (RedHat). - package: name=iproute state=present - when: ansible_os_family == 'RedHat' - - - name: Ensure test dependencies are installed (Debian). - package: name=iproute2 state=present - when: ansible_os_family == 'Debian' - - - name: Gather facts. - action: setup - - roles: - - role: geerlingguy.docker - - role: geerlingguy.kubernetes - - post_tasks: - - name: Get cluster info. - command: kubectl cluster-info - changed_when: false - register: kubernetes_info - - - name: Print cluster info. - debug: var=kubernetes_info.stdout - - - name: Get all running pods. - command: kubectl get pods --all-namespaces - changed_when: false - register: kubernetes_pods - - - name: Print list of running pods. - debug: var=kubernetes_pods.stdout diff --git a/molecule/default/yaml-lint.yml b/molecule/default/yaml-lint.yml deleted file mode 100644 index c9aab08..0000000 --- a/molecule/default/yaml-lint.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -extends: default -rules: - line-length: - max: 150 - level: warning