def main():
    loggingsetup.go()
    parser = argparse.ArgumentParser(
        description='generates a .travis.yml from building/testing Ansible roles with dcb/docker'
    )
    log = logging.getLogger('ansible-galaxy-local-deps.gendottravis.main')
    parser.add_argument('roledirs', nargs='*', default=['.'])
    parser.add_argument('-c', '--cidist', default='focal')
    parser.add_argument('-p', '--pythonver', default='3.9')
    parser.add_argument('-d', '--dcbver', default='0.0.19')
    parser.add_argument('-l', '--ansiblegalaxylocaldepsver', default='0.0.20')
    parser.add_argument('-a', '--action', default='from_dottravis')
    args = parser.parse_args()
    for role_dir in args.roledirs:
        if args.action == 'from_dcb_os':
            from_dcb_os(
                role_dir,
                args.cidist,
                args.pythonver,
                args.dcbver,
                args.ansiblegalaxylocaldepsver
            )
        elif args.action == 'from_dottravis':
            from_dottravis(
                role_dir,
                args.cidist,
                args.pythonver,
                args.dcbver,
                args.ansiblegalaxylocaldepsver
            )
        else:
            log.warning('unknown action: {}'.format(args.action))
Exemplo n.º 2
0
def main():
    loggingsetup.go()

    parser = argparse.ArgumentParser(
        description='uses ansible-galaxy to install all of an Ansible roles meta/main.yml specified requirements'
    )
    parser.add_argument('roledirs', nargs='*', default=['.'])
    args = parser.parse_args()
    for roledir in args.roledirs:
        run(roledir)
Exemplo n.º 3
0
def main() -> None:
    loggingsetup.go()

    parser = argparse.ArgumentParser(
        description=
        'generates a requirements.yml from an Ansible roles meta/main.yml file'
    )
    parser.add_argument('roledirs', nargs='*', default=['.'])
    args = parser.parse_args()
    for roledir in args.roledirs:
        run(roledir)
Exemplo n.º 4
0
def main() -> None:
    loggingsetup.go()

    parser = argparse.ArgumentParser(
        description=
        'modified a dependency in an Ansible roles meta/main.yml file')
    parser.add_argument('roledirs', nargs='*', default=['.'])
    parser.add_argument('--ifcontainsrole')
    parser.add_argument('--todrop')
    args = parser.parse_args()
    for roledir in args.roledirs:
        run(roledir, args.ifcontainsrole, args.todrop)
Exemplo n.º 5
0
def main():
    loggingsetup.go()
    parser = argparse.ArgumentParser(
        description='generates a .github/workflows/build.yml for building/testing Ansible roles with dcb/docker'
    )
    log = logging.getLogger('ansible-galaxy-local-deps.gengithubactions.main')
    parser.add_argument('roledirs', nargs='*', default=['.'])
    parser.add_argument('-c', '--cidist', default='ubuntu-latest')
    parser.add_argument('-p', '--pythonver', default='3.9')
    parser.add_argument('-d', '--dcbver', default='0.1.2')
    args = parser.parse_args()
    for role_dir in args.roledirs:
        mksubdirs(role_dir, [".github", "workflows"])
        from_dcb_os(
            role_dir,
            args.cidist,
            args.pythonver,
            args.dcbver
        )