Would you please read the following and then answer these
questions: Is the name "line" intuitive or confusing and, if
confusing, what would you suggest instead? Is the parameter name
"regexp" intuitive or confusing and, if confusing, what would you
suggest instead?
# line module - assures that a line exists in a file
#
# Much as the file module assures that a file exists in the
filesystem, this module
# extends the same semantics to one line within one file. You
specify the filename,
# the regular expression which "identifies" the line (much as
the filename identifies
# the file), and the value that the line must have (much as you
specify the contents
# of the file). Just as the file module allows an administrator
to control individual
# files in the filesystem while leaving the remaining files
uncontrolled, the line
# modules allows an administrator to control individual lines in
a file while leaving
# the remaining lines uncontrolled.
#
# Parameters:
# dest: Absolute path of the file on the filesystem
# regexp: Regular expression which matches the line in the file
(if the line is present).
# Note - You should write a regular expression which
matches exactly 0 or 1 line.
# value: The exact value of the line which should exist in the
file (not a regular expression)
# state: Either "exists" or "absent"
#
# Examples:
# dest=/etc/hosts regexp="^127.0.0.1 " value="127.0.0.1
localhost localhost.localdomain" state=present
# Assures that /etc/hosts has a correct line for localhost. It
would, for instance, fix a line which
# read only "127.0.0.1 localhost", adding
"localhost.localdomain" to the end of the line.
#
# dest=/etc/apache2/httpd.conf regexp="^SSLCipherSuite "
value="SSLCipherSuite
ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM"
state=present
# Assures that a defined set of ciphers is enabled in Apache.
Thanks,
-- Art Z.
-- http://CheerfulCurmudgeon.com/ "Be kind, for everyone you meet is fighting a hard battle." Plato
Folks,
I am writing my "line" module, which will extend the semantics of managing one file within a filesystem to managing one line within one file within a filesystem. I have a few goals in mind here:
- Simple and declarative. This is not about performing arbitrary edits on a file. This is about declaring that a line must be present (or absent).
- Idempotent. The file will not be edited unless a change is required.
- Intuitive. Humans should be able to use it. You don't need to be a sed or perl or regex guru to get the job done.
Would you please read the following and then answer these questions: Is the name "line" intuitive or confusing and, if confusing, what would you suggest instead? Is the parameter name "regexp" intuitive or confusing and, if confusing, what would you suggest instead?
BTW, I think Michael and I disagree about the appropriateness of thismodule because we have different points of view. Michael sees this asinappropriately editing the contents of files. (I hope that I did notmisrepresent your opinion, Michael.) I see it as extending configurationmanagement down from files within the filesystem to lines within files.This probably means that Michael and I have different problems to solve.