Package: auton
auton projectauton is a free and open-source, we develop it to run programs and command-lines on remote servers through HTTP protocol.
There are two programs, auton for client side and autond for server side.
auton is just a helper to transform command-lines into HTTP protocol, it is able to transform basic arguments, file arguments and environment variables.
For example, you can use auton from CI/CD to run on remote servers, you just need to configure your endpoints:ansiblecurlterraformYou can also use auton if you need to execute a new version of a software but you can't install it on a legacy server
or tests programs execution.QuickstartUsing autond in Dockerdocker-compose up -dSeedocker-compose.ymlInstallationautond for server sidepip install autondauton for client sidepip install autonEnvironment variablesautondVariableDescriptionDefaultAUTOND_CONFIGConfiguration file contents(e.g.export AUTOND_CONFIG="$(cat auton.yml)")AUTOND_LOGFILELog file path/var/log/autond/daemon.logAUTOND_PIDFILEautond pid file path/run/auton/autond.pidAUTON_GROUPauton groupauton or rootAUTON_USERauton userauton or rootautonVariableDescriptionDefaultAUTON_AUTH_USERuser for authenticationAUTON_AUTH_PASSWDpassword for authenticationAUTON_ENDPOINTname of endpointAUTON_LOGFILELog file path/var/log/auton/auton.logAUTON_NO_RETURN_CODEDo not exit with return code if presentFalseAUTON_UIDauton job uidrandom uuidAUTON_URIautond URI(s)(e.g.http://auton-01.example.org:8666,http://auton-02.example.org:8666)Autond configurationSee configuration exampleetc/auton/auton.yml.exampleEndpointsIn this example, we declared three endpoints: ansible-playbook-ssh, ansible-playbook-http, curl.
They used subproc plugin.endpoints:ansible-playbook-ssh:plugin:subprocconfig:prog:ansible-playbooktimeout:3600args:-'/etc/ansible/playbooks/ssh-install.yml'-'--tags'-'sshd'become:enabled:trueenv:DISPLAY_SKIPPED_HOSTS:'false'ansible-playbook-http:plugin:subprocconfig:prog:ansible-playbooktimeout:3600args:-'/etc/ansible/playbooks/http-install.yml'-'--tags'-'httpd'become:enabled:trueenv:DISPLAY_SKIPPED_HOSTS:'false'curl:plugin:subprocconfig:prog:curltimeout:3600AuthenticationTo enable authentication, you must addauth_basicandauth_basic_filelines in sectiongeneral:auth_basic:'Restricted'auth_basic_file:'/etc/auton/auton.passwd'Usehtpasswdto generateauth_basic_file:htpasswd -c -s /etc/auton/auton.passwd fooAnd you have to add for each modules routeauth: true:modules:job:routes:run:handler:'job_run'regexp:'^run/(?P<endpoint>[^\/]+)/(?P<id>[a-z0-9][a-z0-9\-]{7,63})$'safe_init:trueauth:trueop:'POST'status:handler:'job_status'regexp:'^status/(?P<endpoint>[^\/]+)/(?P<id>[a-z0-9][a-z0-9\-]{7,63})$'auth:trueop:'GET'Use sectionusersto specify users allowed by endpoint:ansible-playbook-ssh:plugin:subprocusers:maintainer:truebob:trueconfig:prog:ansible-playbooktimeout:3600args:-'/etc/ansible/playbooks/ssh-install.yml'-'--tags'-'sshd'become:enabled:trueenv:DISPLAY_SKIPPED_HOSTS:'false'Plugin subprocsubproc plugin executes programs with pythonsubprocess.Predefined AUTON environment variables during execution:VariableDescriptionAUTONMark the job is executed in AUTON environmentAUTON_JOB_TIMECurrent time in local time zoneAUTON_JOB_GMTIMECurrent time in GMTAUTON_JOB_UIDCurrent job uid passed from clientAUTON_JOB_UUIDUnique ID of the current jobUse keywordprogto specify program path:endpoints:curl:plugin:subprocconfig:prog:curlUse keywordworkdirto change the working directory:endpoints:curl:plugin:subprocconfig:prog:curlworkdir:somedir/Use keywordsearch_pathsto specify paths to searchprog:endpoints:curl:plugin:subprocconfig:prog:curlsearch_paths:-/usr/local/bin-/usr/bin-/binUse sectionbecometo execute with an other user:endpoints:curl:plugin:subprocconfig:prog:curlbecome:enabled:trueuser:fooUse keywordtimeoutto raise an exception after n seconds (default: 60 seconds):endpoints:curl:plugin:subprocconfig:prog:curltimeout:3600Use sectionargsto define arguments always present:endpoints:curl:plugin:subprocconfig:prog:curlargs:-'-s'-'-4'Use keyworddisallow-argsto disable arguments from client:endpoints:curl:plugin:subprocconfig:prog:curlargs:-'-vvv'-'https://example.com'disallow-args:trueUse sectionargfilesto define arguments files always present:endpoints:curl:plugin:subprocconfig:prog:curlargfiles:-arg:'--key'filepath:/tmp/private_key-arg:'-d@'filepath:/tmp/dataUse keyworddisallow-argfilesto disable arguments files from client:endpoints:curl:plugin:subprocconfig:prog:curlargfiles:-arg:'--key'filepath:/tmp/private_key-arg:'-d@'filepath:/tmp/datadisallow-argfiles:trueUse sectionenvto define environment variables always present:endpoints:curl:plugin:subprocconfig:prog:curlenv:HTTP_PROXY:http://proxy.example.com:3128/HTTPS_PROXY:http://proxy.example.com:3128/Use keyworddisallow-envto disable environment variables from client:endpoints:curl:plugin:subprocconfig:prog:curlenv:HTTP_PROXY:http://proxy.example.com:3128/HTTPS_PROXY:http://proxy.example.com:3128/disallow-env:trueUse sectionenvfilesto define environment variables files always present:endpoints:curl:plugin:subprocconfig:prog:curlenvfiles:-somedir/foo.env-somedir/bar.envUse keyworddisallow-envfilesto disable environment files from client:endpoints:curl:plugin:subprocconfig:prog:curlenvfiles:-somedir/foo.env-somedir/bar.envdisallow-envfiles:trueAuton command-linesendpoint curl examples:Get URLhttps://example.com:auton --endpoint curl --uri http://localhost:8666 -a 'https://example.com'Get URLhttps://example.comwith auton authentication:auton --endpoint curl --uri http://localhost:8666 --auth-user foo --auth-passwd bar -a 'https://example.com'Add environment variable HTTP_PROXY:auton --endpoint curl --uri http://localhost:8666 -a 'https://example.com' -e 'HTTP_PROXY=http://proxy.example.com:3128/'Import already declared environment variable with argument --imp-env:HTTPS_PROXY=http://proxy.example.com:3128/ auton --endpoint curl --uri http://localhost:8666 -a 'https://example.com' --imp-env HTTPS_PROXYLoad environment variables from local files:auton --endpoint curl --uri http://localhost:8666 -a 'https://example.com' --load-envfile foo.envTell to autond to load environment variables files from its local fs:auton --endpoint curl --uri http://localhost:8666 -a 'https://example.com' --envfile /etc/auton/auton.envAdd multiple autond URIs for high availability:auton --endpoint curl --uri http://localhost:8666 --uri http://localhost:8667 -a 'https://example.com'Add arguments files to send local files:auton --endpoint curl --uri http://localhost:8666 -A '--cacert=cacert.pem' -a 'https://example.com'Add multiple arguments:auton --endpoint curl --uri http://localhost:8666 --multi-args '-vvv -u foo:bar https://example.com' --multi-argsfiles '-d@=somedir/foo.txt -d@=bar.txt --cacert=cacert.pem'Get file contents from stdin with-:cat foo.txt | auton --endpoint curl --uri http://localhost:8666 --multi-args '-vvv -u foo:bar sftp://example.com' --multi-argsfiles '--key=private_key.pem --pubkey=public_key.pem -T=-'