Giter VIP home page Giter VIP logo

ansible-collection-assertions's Introduction

Hi there, I'm Marc Wrobel, a developer from France ๐Ÿ‘‹

Github Linkedin StackOverflow Blog Mail

ansible-collection-assertions's People

Contributors

dependabot[bot] avatar marcwrobel avatar

Watchers

 avatar  avatar  avatar

ansible-collection-assertions's Issues

Rename variables to improve readability of assertions

In order to improve assertions readability some variable must be renamed:

  • path -> with_path (in assert_that_file, assert_that_path)
  • name -> with_name (in assert_that_service)
  • multiline_for_content_matching -> using_multiline_for_content_matching (in assert_that_file)
  • ignorecase_for_content_matching -> using_ignorecase_for_content_matching (in assert_that_file)
  • strict_version_parsing -> using_strict_version_parsing

Fix assert_that_distribution message (missing comma)

assert_that_distribution role fail message is wrong : there is a missing comma.

Instead of displaying Expecting one of [ Debian, Debian 10, Debian 10 ] to be in [ OS 1, OS 2, OS 3 ], but none are. it displays Expecting one of [ Debian, Debian 10 Debian 10 ] to be in [ OS 1, OS 2, OS 3 ], but none are..

Add exists, has_type, has_mode, has_owner and has_group assertions to assert_that_file role

Currently making assertions on files and files content require both the role assert_that_file and assert_that_path :

- name: 'Assert that /tmp/test exists, is a file, have mode 0640 and belongs to root:root'
  include_role:
    name: 'marcwrobel.assertions.assert_that_path'
  vars:
    path: '/tmp/test'
    has_type: 'file'
    has_mode: '0640'
    has_owner: 'root'
    has_group: 'root'

- name: 'Assert that /tmp/test is Ansible managed'
  include_role:
    name: 'marcwrobel.assertions.assert_that_file'
  vars:
    path: '/path/to/file'
    has_content_matching: '^# Ansible managed'

But making assertions on files is one of the most common type of assertion. In order to reduce the code needed for that it should be possible to make exists, has_type, has_mode, has_owner and has_group assertions with assert_that_file role.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.