kkirsche / ansible-generator Goto Github PK
View Code? Open in Web Editor NEWGenerate ansible directory structures quickly and easily
Home Page: https://pypi.python.org/pypi/ansible-generator
License: BSD 4-Clause "Original" or "Old" License
Generate ansible directory structures quickly and easily
Home Page: https://pypi.python.org/pypi/ansible-generator
License: BSD 4-Clause "Original" or "Old" License
Hello,
Cool project!
With the following setup, I'm unable to get the --roles
option to run ansible-galaxy
and create the roles, unless --projects
is also used in conjunction with it. The verbose output does not show any errors, and it does indeed create the roles
folder, it just doesn't populate it. Based on the examples given in the readme
it would appear that invoking ansible-generate
in the cwd is acceptable, so I wanted to report this as a bug if this is not the desired behavior.
[tool.poetry.dependencies]
python = "^3.10"
ansible-generator = "^3.0.3"
ansible-core = "^2.13.2"
Failure scenario:
(poetry-3.10) /Volumes/Seagate/testProjects/python_ansible_generator ansible-generate -r common ubuntu centos -a -v
msg="initializing generator" inventories="production, staging" alternate_layout="True" projects=""
msg="beginning create directory"
msg="building alternate inventory layout directory paths"
msg="5 required directories" directories="inventories/staging/group_vars, roles, inventories/production/group_vars, inventories/production/host_vars, inventories/staging/host_vars"
creating directory /Volumes/Seagate/testProjects/python_ansible_generator/inventories/production/group_vars
creating directory /Volumes/Seagate/testProjects/python_ansible_generator/inventories/staging/group_vars
creating directory /Volumes/Seagate/testProjects/python_ansible_generator/inventories/production/host_vars
creating directory /Volumes/Seagate/testProjects/python_ansible_generator/roles
creating directory /Volumes/Seagate/testProjects/python_ansible_generator/inventories/staging/host_vars
building alternate inventory layout file paths
msg="3 required files" files="{'site.yml', 'inventories/production/hosts', 'inventories/staging/hosts'}"
creating file /Volumes/Seagate/testProjects/python_ansible_generator/inventories/production/hosts
creating file /Volumes/Seagate/testProjects/python_ansible_generator/inventories/staging/hosts
creating file /Volumes/Seagate/testProjects/python_ansible_generator/site.yml
Success scenario:
(poetry-3.10) /Volumes/Seagate/testProjects/python_ansible_generator ansible-generate -r common ubuntu centos -a -v -p test_playbook
msg="initializing generator" inventories="production, staging" alternate_layout="True" projects="test_playbook"
msg="beginning create directory"
msg="building alternate inventory layout directory paths"
msg="5 required directories" directories="inventories/staging/host_vars, inventories/production/host_vars, inventories/staging/group_vars, roles, inventories/production/group_vars"
msg="projects was defined" projects="test_playbook"
msg="5 project required directories" directories="test_playbook/roles, test_playbook/inventories/staging/group_vars, test_playbook/inventories/staging/host_vars, test_playbook/inventories/production/host_vars, test_playbook/inventories/production/group_vars"
creating directory /Volumes/Seagate/testProjects/python_ansible_generator/test_playbook/inventories/production/group_vars
creating directory /Volumes/Seagate/testProjects/python_ansible_generator/test_playbook/inventories/staging/group_vars
creating directory /Volumes/Seagate/testProjects/python_ansible_generator/test_playbook/inventories/production/host_vars
creating directory /Volumes/Seagate/testProjects/python_ansible_generator/test_playbook/roles
creating directory /Volumes/Seagate/testProjects/python_ansible_generator/test_playbook/inventories/staging/host_vars
building alternate inventory layout file paths
msg="3 required files" files="{'inventories/staging/hosts', 'inventories/production/hosts', 'site.yml'}"
msg="projects was defined" projects="['test_playbook']"
msg="3 project required files" files="{'test_playbook/inventories/staging/hosts', 'test_playbook/site.yml', 'test_playbook/inventories/production/hosts'}"
creating file /Volumes/Seagate/testProjects/python_ansible_generator/test_playbook/inventories/staging/hosts
creating file /Volumes/Seagate/testProjects/python_ansible_generator/test_playbook/site.yml
creating file /Volumes/Seagate/testProjects/python_ansible_generator/test_playbook/inventories/production/hosts
ansible-galaxy output for role common:
- Role common was created successfully
ansible-galaxy output for role ubuntu:
- Role ubuntu was created successfully
ansible-galaxy output for role centos:
Right now, everything is hidden behind flags, which is fine but potentially not the most intuitive. It'd be easier I think for people if instead the tool used the positional arguments to capture projects which has a higher chance of being what people expect.
Reported via sentry
FileNotFoundError: [Errno 2] No such file or directory: '/run/user/REDACTED/Ansible/dev/inventories/caca'
File "ansible_generator/files.py", line 85, in touch
with open(filename, "a") as f:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.