Code Monkey home page Code Monkey logo

aviary.sh's People

Contributors

arp242 avatar dchester avatar gastrodon avatar keevie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aviary.sh's Issues

Issue and Fix

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

Question About Directive Scripts

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?

Doesn't release lock if errored - eg an error in remote inventory repository

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 error

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

Template keyword clashing with pwntools Lib

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.

Host not in inventory

root@pfv-vmsrv-01:# hostname
pfv-vmsrv-01
root@pfv-vmsrv-01:
# hostname -f
pfv-vmsrv-01.pfv.turnsys.net
root@pfv-vmsrv-01:# ls /var/lib/aviary/inventory/
inventory README.md
root@pfv-vmsrv-01:
# ls /var/lib/aviary/inventory/inventory/
directives hosts modules roles
root@pfv-vmsrv-01:# ls /var/lib/aviary/inventory/inventory/hosts/
pfv-vmsrv-01 pfv-vmsrv-01.turnsys.net tsys-cloud-www
root@pfv-vmsrv-01:
# av apply
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.

All activity on this system is subject to monitoring. By accessing this system, you consent to any and all monitoring.
If information collected reveals possible criminal activity or activity that exceeds privileges, evidence of such activity
may be provided to the relevant authorities for further action. By continuing past this point, you expressly consent
to this monitoring.

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.

Heirarchy of variables - using host vars in module vars

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?

Serve https://aviary.sh/install with a text/plain content-type

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.

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.