[PATCH aeolus-configure] Fix paths to /bin/su and /bin/sed

John Eckersberg jeckersb at redhat.com
Fri Aug 31 18:37:04 UTC 2012


Steve Linabery <slinaber at redhat.com> writes:

> Previous commit had these paths incorrect as /usr/bin/(su|sed)
> ---
>  recipes/aeolus/manifests/conductor.pp |    2 +-
>  recipes/postgres/manifests/user.pp    |    8 ++++----
>  2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/recipes/aeolus/manifests/conductor.pp b/recipes/aeolus/manifests/conductor.pp
> index 282d79c..f200526 100644
> --- a/recipes/aeolus/manifests/conductor.pp
> +++ b/recipes/aeolus/manifests/conductor.pp
> @@ -104,7 +104,7 @@ class aeolus::conductor inherits aeolus {
>                 notify  => Service['postgresql']}
>      }
>      exec{ "pgauthuser":
> -      command     => "/usr/bin/sed -i s/ident/md5/ /var/lib/pgsql/data/pg_hba.conf",
> +      command     => "/bin/sed -i s/ident/md5/ /var/lib/pgsql/data/pg_hba.conf",
>        onlyif      => '/bin/grep -q ident /var/lib/pgsql/data/pg_hba.conf',
>        require     => Exec["pginitdb"],
>        notify      => Service["postgresql"]
> diff --git a/recipes/postgres/manifests/user.pp b/recipes/postgres/manifests/user.pp
> index e767e1d..ec3a66f 100644
> --- a/recipes/postgres/manifests/user.pp
> +++ b/recipes/postgres/manifests/user.pp
> @@ -2,13 +2,13 @@ define postgres::user($ensure='created', $password="", $roles=""){
>    case $ensure {
>      'created': {
>        exec{"create_${name}_postgres_user":
> -             unless  => "/usr/bin/test `/usr/bin/su postgres -c \"psql postgres postgres -P tuples_only -c \\\"select count(*) from pg_user where usename='${name}';\\\"\"` = \"1\"",
> -             command => "/usr/bin/su postgres -c \"/usr/bin/psql postgres postgres -c \
> +             unless  => "/usr/bin/test `/bin/su postgres -c \"/usr/bin/psql postgres postgres -P tuples_only -c \\\"select count(*) from pg_user where usename='${name}';\\\"\"` = \"1\"",
> +             command => "/bin/su postgres -c \"/usr/bin/psql postgres postgres -c \
>                           \\\"CREATE USER ${name} WITH PASSWORD '${password}' ${roles}\\\"\""}}
>      'dropped': {
>        exec{"drop_${name}_postgres_user":
> -             onlyif  => "/usr/bin/test `/usr/bin/su postgres -c \"psql postgres postgres -P tuples_only -c \\\"select count(*) from pg_user where usename='${name}';\\\"\"` = \"1\"",
> -             command => "/usr/bin/su postgres -c \"/usr/bin/psql postgres postgres -c \
> +             onlyif  => "/usr/bin/test `/bin/su postgres -c \"/usr/bin/psql postgres postgres -P tuples_only -c \\\"select count(*) from pg_user where usename='${name}';\\\"\"` = \"1\"",
> +             command => "/bin/su postgres -c \"/usr/bin/psql postgres postgres -c \
>                           \\\"DROP USER ${name}\\\"\""}}
>    }
>  }
> -- 
> 1.7.7.6

This is different on Fedora 17+, see
http://fedoraproject.org/wiki/Features/UsrMove

(On F17, /bin is a symlink to /usr/bin)

We should just set the path parameter for the exec type, and let that
find the right executable regardless of where it is in the search path.
I'll throw something together here momentarily...



More information about the aeolus-devel mailing list