Skip to content

Commit

Permalink
AV-89941 #comment update lint syntax to support molecule 3
Browse files Browse the repository at this point in the history
  • Loading branch information
sabandi committed Aug 20, 2020
1 parent cc94376 commit 076ebff
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 19 deletions.
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
skip_list:
- 305
- 306
- 208
use_default_rules: true
18 changes: 11 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
---
language: python
services:
- docker
services: docker

before_install:
- sudo apt-get -qq update
# Ensure pip is present
addons:
apt:
packages:
- python-pip

install:
# Install required packages
- pip install molecule yamllint ansible-lint flake8 testinfra docker

env:
global:
- ROLE_NAME: avicontroller
matrix:
- MOLECULE_DISTRO: centos:7
- MOLECULE_DISTRO: centos:8
MOLECULE_SERVICE_MANAGER: systemd
MOLECULE_COMMAND: /usr/sbin/init

install:
- pip install testinfra molecule docker

before_script:
- cd ../
Expand Down
16 changes: 8 additions & 8 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
platforms:
- name: instance
image: centos:7
image: docker.io/pycontribs/centos:8
pre_build_image: true
lint: |
set -e
yamllint .
ansible-lint
flake8
provisioner:
name: ansible
lint:
name: ansible-lint
verifier:
name: testinfra
lint:
name: flake8
name: testinfra
9 changes: 5 additions & 4 deletions molecule/default/tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
import testinfra.utils.ansible_runner

testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")


def test_hosts_file(host):
f = host.file('/etc/hosts')
f = host.file("/etc/hosts")

assert f.exists
assert f.user == 'root'
assert f.group == 'root'
assert f.user == "root"
assert f.group == "root"

0 comments on commit 076ebff

Please sign in to comment.