# -*- mode: org; mode: auto-fill; -*- #+TODO: TODO | DONE CANCELED #+startup: showeverything * [0/15] 1.0.0 version Some of these need further work on the Org Ruby parser. - [ ] Macros can be loaded and applied to the configuration - [ ] Support for ~#+SETUPFILE~ To load the macros - [ ] Support converging and idempotency (~--runmode=idempotent~) + Do not do an operation unless it is required + Abort in case there was a failure in executing one of the scripts. - [ ] Heuristics for determining which binary to use for running the script - [ ] Display how the run would look like without making changes : org-converge setupfile.org --dry-run - [ ] Bugfix for when results blocks have only inline examples or images - [ ] Bugfix for when the result from a ~org-spec~ run has non-zero exit status - [ ] =:eval= For evaling blocks (off by default) - [ ] =:onerror= aborteverything, restart, runhandler - [ ] =:asserts= - [ ] =:waits:= Wait for other processes to start before starting. The process does not start until the alive signal to the following list of processes succeeds. - [ ] =:awaits:= Wait for other processes to finish before starting. - [ ] =:file= For storing the output from the evaluation (already done in spec mode) - [ ] =:cache true= Also part of the idempotency checks. - [ ] =:env= and =#+envfile:= * [1/1] 0.0.15 - [X] Can use =:dir= for running a process remotely via ssh. This needs the remote credentials to be available. * [2/2] 0.0.14 All of the following makes it required to track the result from the runs. - [X] Can use =:dir= for running a process relative to that directory - [X] =:if= and =:unless= checks First step at achieving idempotency. This tracks the result from another block. In case the block results in exit 0, then true. Otherwise false. * [2/2] 0.0.13 - [X] =:waitsfor=, =:waitfor=, =:sleep:= The process starts after this delay - [X] =:timeoutin=, =:timeout= The process stops running after this time * [1/1] 0.0.12 - [X] Use the shebang for the binary #+begin_src ruby :results output cmd = "#!/bin/bash".gsub('#!', '') puts cmd #+end_src #+RESULTS: : /bin/bash * [1/1] 0.0.11 - [X] Normalize the binaries used for some languages (bash, node) * [1/1] 0.0.10 - [X] Add ~:procs~ to code blocks to identify how many times it should run * [1/1] 0.0.8, 0.0.9 version - [X] ~org-spec~ exploration! * [2/2] 0.0.7 version - [X] Add ~org-run~ and ~org-tangle~ aliases - [X] Use rake task manager * [3/3] 0.0.6 version # - [ ] Keyword to accumulate run blocks - [X] Run specific blocks defined by name (using a regex expression) - [X] Change the format of the logger - [X] Do not run blocks in commented headlines * [2/2] 0.0.5 version - [X] Do not run or tangle blocks without arguments - [X] Keyword to activate runmode in the text itself * [1/1] 0.0.4 version - [X] Support runlists notifications via =#+NAME:= * [2/2] 0.0.3 version - [X] Support sequential and parallel execution - [X] Can use :mkdirp for 0644 permissions * [2/2] 0.0.2 version of org-converge Run the code blocks! - [X] Code blocks are executed by default after tangling in temp dir Only when ~:shebang~ exists as an argument - [X] Default parallel execution of blocks * [3/3] 0.0.1 version Need some basic functionality of what Org babel offers first. - [X] Display files that were captured with command : org-converge setupfile.org --showfiles - [X] ~:tangle~ puts the files in the correct path - [X] ~--tangle~ flag - [X] Support a root dir for when not running relative to the directory * [9/20] Ideas ** TODO Chaining resources with =#+name:= directives and =:notify= argument One idea is to be able to notify resources by naming the code blocks. Example: Here first the td-agent service would try to start, and if it succeeds, then it would execute the script defined in the ~announce-availability~ resource. #+name: td-agent-start #+begin_src sh :notify announce-availability sudo service td-agent start #+end_src #+name: announce-availability #+begin_src sh sudo /etc/register-to-balancer #+end_src - Support for ~:before all~ and ~:after all~ added ** TODO Add namespace dynamically to the tasks using an in buffer setting There can be some potential scoping issues when using =#+include:= ** TODO Clarify which ones of the header arguments to implement http://orgmode.org/manual/Specific-header-arguments.html#Specific-header-arguments ** TODO For now we keep the indentation of the code blocks The indentatin of the ~#+begin_src~ should always be at the beginning of the file, not at the indentation level from when the file was written in Org mode. ** TODO We should have a whitelist of languages that can be executed and ignore everything else Under which heuristics or configuration should we decide which will be the binary that should be used to execute the block? Specify with shebang? - For now, unless shebang is specified it will be executed. Then in the scripts buffer used ~index::shebang~ as a key. ** TODO Setting permissions from a tangled file It should be possible to tangle the files this way: #+begin_src conf :tangle etc/something/config/path :chmod 0664 :user td-agent :group td-agent #+end_src ** TODO Adopting the ~#+SETUPFILE~ for loading a config that is done JSON or YAML It seems that there is support for a ~#+SETUPFILE~ ** TODO Something more flexible than macros for templating One example of syntax that we could use instead of macros. One idea is to use the =:session= argument and different drivers for languages that are commonly used for the configuration. This would inject the settings into a =@macros= hash from where the values can be picked up to be applied at runtime, sort of like the overrride attributes feature from Chef. #+begin_src yaml :session fluentd: port: 4224 path: here.log #+end_src Or also json could be used: #+begin_src js :session { "fluentd": { "port": 4224, "path": "here.log" } } #+end_src Or even just plain Ruby? #+begin_src ruby :session session = { "fluentd" => { "port" => 4224, "path" => "here.log" } } #+end_src ** TODO Choosing a templating language We could implement the macro systems, but it seems that it may not be strong enough for providing with all the cases we may run into. ** TODO Support =:cache=? #+begin_src emacs-lisp :cache yes :exports results (random) #+end_src #+RESULTS[db54597aed193d861d01bf92110e10f28f8f40d4]: : 842438499349743708 ** TODO Support =:eval=? #+begin_src sh :eval (print "Really doing this...") echo "Going ahead with operation X!" #+end_src ** DONE By default, it should use current dir for tangling ** DONE Converging: Only do an operation when it didn't finish Hence the name of the project ** DONE ~#+NAME:~ could be used in the logger for identifying the process ** DONE Managing dependencies: could be handled with ~#+include~ directives One idea is that it would be useful to compile different manuals that are dependent among each other. For example, the centralized logs server would require fluentd. We should be able to express that dependency somehow: #+begin_src org :tangle logserver.org ,#+include: "fluentd.org" ,* Setup the centralized logserver :setup: ,Once the fluentd.org has been converged, we can build upon this and ,override the original config to make it particular for this logserver #+end_src # But one problem, is that once I have included something, sometimes we # will want "reopen" the previous manuals? ** DONE We don't need to create the directories in most cases (:mkdirp yes) Something like this is not required because the ~:tangle~ blocks would create the necessary directories behind the scenes. #+begin_src org ,We need to prepare some directories for the configuration: ,#+begin_src converge ,mkdir -p etc/fluentd/config ,#+end_src #+end_src ** CANCELED Use sshkit for running remote processes ** CANCELED How to set the permissions from the directory from the file that is being tangled when it does not exists? By default, this would be 0644, but we also need to specify the user:group of it so the syntax would have to be: #+begin_src conf :tangle etc/something/config/path :chmod 0664 :user td-agent :group hmm dont't like this syntax for folders #+end_src Let's keep it simple and just use a babel block that shells out to create the directories until I can think of something better. ** CANCELED Using the :tags: to setup the things to run right away Using the block ~#+name~ instead. Kind of like the chef-solo runlist, a headline like this... #+begin_src org ,* Everything in its right place :config: ,#+begin_src conf :tangle etc/this.yml ,hello: "world" ,#+end_src #+end_src ...could be called like this #+begin_src sh org-converge fluentd.org -t config #+end_src ** CANCELED Loading all the Org mode files first and then setup only one part Used ~#+name~ from blocks instead. So maybe, each one of these tags would have to be namespaces under the name of the file: : org-converge logserver.org -t "fluentd::setup, fluentd::config, logserver::setup" * Links http://eschulte.github.io/org-scraps http://doc.norang.ca/org-mode.html