frameable / aviary.sh Goto Github PK
View Code? Open in Web Editor NEWMinimal distributed configuration management in bash
License: MIT License
Minimal distributed configuration management in bash
License: MIT License
In my setup, when running av apply
, nothing was happening. I was able to trace the issue back to the variables
file. It appears that referencing the inventory directory, as specified in the configuration file, fails. In other words, when $inventory_dir
is called, a null value is returned. I was able to fix this issue by prepending source config
to the file. I recommend implementing this change, as it appears that, otherwise, the use of variables is broken.
Let me know if this was just an issue with my setup, and/or if this wasn't helpful.
I'm running Ubuntu Server 20.04 LTS
Is there a repository of already written modules that are ready to be used?
The directives directory contains bash scripts to be executed once on each host, immediately when they are discovered. Only directive scripts with modification times within the most recent 24 hours will be considered for execution.
Does this mean that if I set up a new server, but I haven't updated the directive script within the past 24 hours, it won't run? For example, let's say that I want to fully wipe and set back up a server with the same hostname, etc. Would that server no longer run the old directive script? Or, is this trying to say that directive scripts won't be re-run (after always running the first time) unless a recent change is detected? Thanks.
Edit: Also, will directives run for all hosts, or is there a way to choose a specific host/specific hosts for them to run on?
Sorry for the odd question, but I like your diagram on that inventory part of the read me and would like to learn how you made it. Can you share the process?
When there is a problem with the remote inventory repository then aviary errors out as expected but doesn't seem to be able to recover, requiring manual intervention to clean up the lock in order to allow aviary to continue. Requiring manual intervention like this is avoidable if aviary only locks while actually running and is very careful to clean up that lock when it stops executing, even if it stopped because of an error.
Here's an extract from my logs, my cron is set to run every 2 minutes:
2020-10-02 09:27:01.639 | INFO | Fetching inventory
2020-10-02 09:27:11.241 | INFO | Running apply
2020-10-02 09:27:11.243 | INFO | Applying module test
bash: /var/lib/aviary/inventory/modules/test/apply: No such file or directory
2020-10-02 09:27:11.248 | ERROR | The command `LSLOG 10 2>&1` exited with exit code 127
2020-10-02 09:27:11.250 | ERROR | Failed
2020-10-02 09:29:01.372 | INFO | Fetching inventory
2020-10-02 09:29:13.924 | ERROR | Bailing for run lock file; try `av resume`
2020-10-02 09:29:13.926 | ERROR | Failed
2020-10-02 09:31:01.061 | INFO | Fetching inventory
2020-10-02 09:31:11.776 | ERROR | Bailing for run lock file; try `av resume`
2020-10-02 09:31:11.778 | ERROR | Failed
...
av apply
2020-07-01 04:39:49.114 | INFO | Fetching inventory
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
[--exec-path[=]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=] [--work-tree=] [--namespace=]
[]
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
[--exec-path[=]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=] [--work-tree=] [--namespace=]
[]
2020-07-01 04:39:49.130 | ERROR | The command git -C $inventory_dir reset --hard > /dev/null
exited with exit code 129
2020-07-01 04:39:49.135 | ERROR | Failed
Hello,
After testing a bit the template feature, I encountered a problem with the template feature.
After a very quick search I realised the Pwntools lib already installed on my computer is clashing with the template function as shown in this example from the readme:
# inventory/modules/motd/apply
source template
source variables
template $(dirname $0)/motd.template > /etc/motd
For reference, the python script clashing in the pwntool lib.
While the fix is as easy as renaming the conflicting file, it might be the perfect moment to change the template keyword to an aviary-specific name (av-template ?) to avoid further troubles in the future.
root@pfv-vmsrv-01:# hostname# hostname -f
pfv-vmsrv-01
root@pfv-vmsrv-01:
pfv-vmsrv-01.pfv.turnsys.net
root@pfv-vmsrv-01:# ls /var/lib/aviary/inventory/# ls /var/lib/aviary/inventory/inventory/
inventory README.md
root@pfv-vmsrv-01:
directives hosts modules roles
root@pfv-vmsrv-01:# ls /var/lib/aviary/inventory/inventory/hosts/# av apply
pfv-vmsrv-01 pfv-vmsrv-01.turnsys.net tsys-cloud-www
root@pfv-vmsrv-01:
2020-07-20 17:40:58.088 | INFO | Fetching inventory
========================================================================================================================
This system is restricted for Turn Net Systems LLC members and authorized employees/contractors only.
2020-07-20 17:40:59.193 | ERROR | Couldn't find host pfv-vmsrv-01 in inventory
2020-07-20 17:40:59.194 | ERROR | Failed
root@pfv-vmsrv-01:~#
Let me.know if more info is need or if I am missing something obvious please.
Running av apply --log-level debug
(working) gives different result than av apply
(broken).
Not providing a log level argument causes the following error:
2020-08-31 13:20:40.768 | ERROR | The command `LSLOG 10 2>&1` exited with exit code 141
2020-08-31 13:20:40.770 | ERROR | Failed
Here is a minimal example to reproduce the issue: https://github.com/tinoadams/aviary-test
Was it a deliberate decision to not support variables
files in the roles?
I like the simplicity of this tool a lot! Thanks for putting it together.
I've been trying to build a PoC and run into a problem: I can't figure out how to have module variables that may contain host variables. For example:
# In the module variables file
deploy_to_path="/var/www/${project}-${instance}-${env}"
where some of those variables are defined in the host vars.
Is it possible to build hierarchies of variables like this?
https://aviary.sh/install is currently served with a application/octet-stream
content-type:
$ curl -i https://aviary.sh/install
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 1266
Server: GitHub.com
Content-Type: application/octet-stream
...
This means that when I visit https://aviary.sh/install in my browser I get a prompt to download the script.
I never like to run curl https://aviary.sh/install | sudo bash
without first eye-balling the script I'm about to execute. Serving that script with text/plain
would make it much easier to see what it's actually going to do.
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.