Add cdist "task" support #85

Open
opened 2021-11-20 13:23:41 +00:00 by ungleich-gitea · 7 comments

Background: When using cdist intensively, often you'll yourself typing the same commands for some things.
For instance at ungleich I use frequently:

  • (A) echo __ungleich_staff_ssh_keys | cdist config -vv -j7 -p host1 host2
  • Add / remove keys of all staff members to hosts
  • (B) cdist config -vv -j7 -p d{1..7}.ungleich.ch
  • Configure all DNS servers
  • (C) cdist config -vv -j7 -p mx.place5.ungleich.ch
  • Update the mailserver config
  • (D) echo __timezone Europe/Berlin | cdist config host1 host2 ...
  • Setup the correct time zone

Instead of having to remember, I envision to port the old "cinv process" subcommand to cdist, but name it "task". This should work as follows:

  • we support having ~/.cdist/task.py (or in the -c directory)

  • This can define define classes or methods

  • Maybe inheriting from cdist.Task (?)

  • These classes/methods can simplify / abstract details as follows:

  • (A) cdist task addsshkey host1 host2

  • (B) cdist task configdns # no arguments

  • (C) cdist task configmx # no arguments

  • (D) cdist task set-timezone host1 host2 host3

Obviously if we have tasks, we also support listing them. For instance

  • cdist task -l
Background: When using cdist intensively, often you'll yourself typing the same commands for some things. For instance at ungleich I use frequently: * (A) echo __ungleich_staff_ssh_keys | cdist config -vv -j7 -p host1 host2 * Add / remove keys of all staff members to hosts * (B) cdist config -vv -j7 -p d{1..7}.ungleich.ch * Configure all DNS servers * (C) cdist config -vv -j7 -p mx.place5.ungleich.ch * Update the mailserver config * (D) echo __timezone Europe/Berlin | cdist config host1 host2 ... * Setup the correct time zone Instead of having to remember, I envision to port the old "cinv process" subcommand to cdist, but name it "task". This should work as follows: * we support having ~/.cdist/task.py (or in the -c directory) * This can define define classes or methods * Maybe inheriting from cdist.Task (?) * These classes/methods can simplify / abstract details as follows: * (A) cdist task addsshkey host1 host2 * (B) cdist task configdns # no arguments * (C) cdist task configmx # no arguments * (D) cdist task set-timezone host1 host2 host3 Obviously if we have tasks, we also support listing them. For instance * cdist task -l
Author
Owner

unassigned @poljakowski

unassigned @poljakowski
Author
Owner

Examples to be implemented:

  • cdist task create-django-hosting --name aname --project-name customersupplied
  • cdist task create-vpn --public-key
  • cdist task create-glarnercloud --name aname
Examples to be implemented: * cdist task create-django-hosting --name aname --project-name customersupplied * cdist task create-vpn --public-key <keyofcustomer> * cdist task create-glarnercloud --name aname
Author
Owner

mentioned in merge request !830

mentioned in merge request !830
Author
Owner

assigned to @poljakowski and unassigned @ahmedbilal

assigned to @poljakowski and unassigned @ahmedbilal
Author
Owner

"we" have init manifest per host, which has all the calls to types for configuring dns, setting timezone and... heh... disabling ipv6 :) etc.

i find this way more explicit and manifest is then kind of like documentation saying what has been done with host.

saying that, i'm not seeing any benefits having task command, because our process is different.

ymmv

"we" have init manifest per host, which has all the calls to types for configuring dns, setting timezone and... heh... disabling ipv6 :) etc. i find this way more explicit and manifest is then kind of like documentation saying what has been done with host. saying that, i'm not seeing any benefits having task command, because our process is different. ymmv
Author
Owner

changed the description

changed the description
Author
Owner

@nico That would ease a lot of pain

@nico That would ease a lot of pain
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ungleich-public/cdist#85
No description provided.