Easy way to force cdist following the created order in manifest #238
Labels
No Label
bugfix
cleanup
discussion
documentation
doing
done
feature
improvement
packaging
Stale
testing
TODO
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: ungleich-public/cdist#238
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created by: dheule
Now we configure the whole manifest like this:
require="$r" __file /home/test/hostname --state absent
r="__file/home/test/hostname"
require="$r" __directory /home/test/public_html --state absent
r="__directory/home/test/public_html"
etc ...
please implement the possibility to force cdist to honor the order in which types are definied / created without the need to specifi a require on every type line.
One idea is to do this if the user exports require="CDIST_HONOR_CREATE_ORDER" or some other special variable exported at the beginning of the manifest.
Thx.
Created by: dheule
Implemented with CDIST_ORDER_DEPENDENCY since 3.0.7
Created by: dheule
I will try to make a hack in the python core next week
Created by: dheule
Hello Nico,
One of my real world examles, red are comments which are not in the
manifest,
but for explain the workflow:
patterns welche fuer sap notwendig sind ...
require="$r" __package ulimit --state absent
r="__package/ulimit"
require="$r" __package Basis-Devel --ptype pattern
r="__package/Basis-Devel"
require="$r" __package file_server --ptype pattern
r="__package/file_server"
require="$r" __package print_server --ptype pattern
r="__package/print_server"
require="$r" __package sap_server --ptype pattern
r="__package/sap_server"
require="$r" __package x11 --ptype pattern
r="__package/x11"
Disable cups on boot
require="$r" __start_on_boot cups --state absent
r="__start_on_boot/cups"
Folgende Keys können erst gesetzt werden nach der installation von
mindestens __package/sap_server
set our values on file /etc/sysconfig/sapconf
require="$r" __key_value LIMIT_1 --file /etc/sysconfig/sapconf --value
'"@sapsys soft nofile 131200"' --delimiter '='
r="__key_value/LIMIT_1"
require="$r" __key_value LIMIT_2 --file /etc/sysconfig/sapconf --value
'"@sapsys hard nofile 131200"' --delimiter '='
r="__key_value/LIMIT_2"
require="$r" __key_value LIMIT_3 --file /etc/sysconfig/sapconf --value
'"@sdba soft nofile 131200"' --delimiter '='
r="__key_value/LIMIT_3"
require="$r" __key_value LIMIT_4 --file /etc/sysconfig/sapconf --value
'"@sdba hard nofile 131200"' --delimiter '='
r="__key_value/LIMIT_4"
require="$r" __key_value LIMIT_5 --file /etc/sysconfig/sapconf --value
'"@dba soft nofile 131200"' --delimiter '='
r="__key_value/LIMIT_5"
require="$r" __key_value LIMIT_6 --file /etc/sysconfig/sapconf --value
'"@dba hard nofile 131200"' --delimiter '='
r="__key_value/LIMIT_6"
require="$r" __key_value LIMIT_7 --file /etc/sysconfig/sapconf --value
'"@dba soft memlock infinity"' --delimiter '='
r="__key_value/LIMIT_7"
require="$r" __key_value LIMIT_8 --file /etc/sysconfig/sapconf --value
'"@dba hard memlock infinity"' --delimiter '='
r="__key_value/LIMIT_8"
require="$r" __key_value LIMIT_9 --file /etc/sysconfig/sapconf --value
'"@sapsys soft memlock infinity"' --delimiter '='
r="__key_value/LIMIT_9"
require="$r" __key_value LIMIT_10 --file /etc/sysconfig/sapconf --value
'"@sapsys hard memlock infinity"' --delimiter '='
r="__key_value/LIMIT_10"
create sap standard users
require="$r" __group sapsys --gid 200
r="__group/sapsys"
require="$r" __group sapinst --gid 210
r="__group/sapinst"
require="$r" __group dba --gid 201
r="__group/dba"
require="$r" __group oper --gid 202
r="__group/oper"
User erstellen braucht die Gruppen vorher
require="$r" __user sapadm --uid 1000 --gid sapsys --comment "SAP System
Administrator" --system --password
'password_hier_gelöscht_da_ich_diesen_hash_nicht_im_inet_möchte'
r="__user/sapadm"
SAP scripts brauchen unser und gruppen
install backup, archive and maintenance scripts
require="$r" __sfs_sles_sapscripts
r="__sfs_sles_sapscripts"
SAP Host agent braucht gruppen,user,sapscript ...
install sap host agent
require="$r" __sfs_sap_hostagent --patch 174
r="__sfs_sap_hostagent"
install sap entrys in services file
require="$r" __sfs_sap_services --version $osv
r="__sfs_sap_services"
install oracle instant client for sap
require="$r" __sfs_sap_oracle_instantclient --version '11.2.0.3.0 V1'
r="__sfs_sap_oracle_instantclient"
. $__manifest/apps/netapp.sh
We have many more examples in other files,
sometimes its a crux, on a old system the order doen't matter when
you test, but on a fresh system with minial install it does matter,
so we fix the order of all type calls with the variable $r on the moment.
This works perfekt in all cases, because we write the manifest
in the order of the installation and dependencies of the system.
I think a cool solution is if we can export a special variable in the
manifest and then all following types are recorded with auto
require="__last_type_which_was_reated" ... possibility in core ?
Greats Daniel
2014/1/17 Nico Schottelius notifications@github.com
Created by: asteven
Nico Schottelius wrote on 01/17/2014 10:38 AM:
I've also been thinking how to solve this. Something like this would be
nice:
in_order=$magic_tool_script_type_something
$in_order << DONE
__foo
__bar
__gurk
DONE
And $magic_tool_script_type_something would turn it into:
__foo
require="__foo" __bar
require="__bar" __gurk
I don't think this is difficult to implement, the interesting question
is where to implement it.
e.g.
Cheers,
Steven
Created by: telmich
Hey Daniel,
we actually excluded this behaviour in the early design days,
because we wanted cdist to be independent of the order of execution.
Background for that is depending on which types you use, the execution
order may be different (of objects) and thus lead to different results
and thus to incosistent configurations.
I do however see the problem you raise, though I haven't encountered
this problem much so far. As it is easy to be wrong when reading mails,
let me rephrase it, so we are both on the same track:
So we can look into how to fix this problem. I'd actually be happy if
you could add some real world examples where it is cumbersome - if it is
just 2 lines in reality, it is probably not worth to restructure the
workflow deeply within cdist.
Cheers,
Nico
dheule [Fri, Jan 17, 2014 at 12:47:38AM -0800]:
PGP key: 7ED9 F7D3 6B10 81D7 0EC5 5C09 D7DC C8E4 3187 7DF0