Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    czantoine
    @czantoine

    Hi all,
    I try to do something in Techniques with Command execution. I would like run shell on my servers like that :
    hostname=$(hostname)
    echo "$hostname" > text.txt

    The code work fine but on my dashboard I have a error statut.
    How can I return that all is well ?

    Nicolas E
    @necar_gitlab
    Hello guys, long time no see, I hope you're all OK, sound and safe, after these complex times.
    Here in Grenoble, back to business with a technical question about Oracle Linux 8.x : I see that the yum package manager is using python (and more specifically a wrapper to detect python2 or 3) and it's failing on my host. Obviously, this comes from python{2 or 3} is not installed by default. After a quick "dnf module install python36", my directives are running nicely. Do you think it could be worth mentioning it somewhere in the doc, or is Oracle Linux considered too a-side (not strictly supported) to bother?
    (wtf, my original login was necarnot... Well, it's still me :) )
    Domagoj Bazina
    @dbazina-dev
    Hello guys,
    Is there generic method or technique that can be used for mounting directories or files?
    Thanks :)
    Nicolas Charles
    @ncharles
    Hi !
    @necar_gitlab yes, it would definitively make sense. Could you open a ticket on the bugtracker? that would be great
    @dbazina-dev There aren't any generic method for that. We used to have a technique for that, but it turned out there were so many edge cases to manage that technique wasn't the best approach. What would you like to mount ?
    Domagoj Bazina
    @dbazina-dev
    @ncharles samba directory
    Nicolas E
    @necar_gitlab

    @necar_gitlab yes, it would definitively make sense. Could you open a ticket on the bugtracker? that would be great

    Hello @ncharles . Here it is : https://issues.rudder.io/issues/19904

    Nicolas Charles
    @ncharles
    @necar_gitlab awesome
    @dbazina-dev interesting - do you knwo which options would be useful for you in mounting it ?
    Domagoj Bazina
    @dbazina-dev
    @ncharles Hmm probably combination of commands. First I'm going to use "directory present", to check whether directory exists, then I'm going to add line in /etc/fstab, so whenever pc boot it will mount the samba directory, probably going to use (file line present). After that i m going to use mount -a
    Domagoj Bazina
    @dbazina-dev
    Is there generic methods, that check content of file, or if some line is present in file?
    czantoine
    @czantoine

    Hi all,
    I try to do something in Techniques with Command execution. I would like run shell on my servers like that :
    hostname=$(hostname)
    echo "$hostname" > text.txt

    The code work fine but on my dashboard I have a error statut.
    How can I return that all is well ?

    Anyone ?

    Nicolas Charles
    @ncharles
    @dbazina-dev yes, file line present ensure that a file contain a line.
    Hi @czantoine - what's the error message?
    czantoine
    @czantoine
    On the compliance reports, status show " missing"
    and i would like resutlt conditions prompt " Success "
    Nicolas Charles
    @ncharles
    I suspect that it's because of the $() - agent tries to evaluate it as variable
    czantoine
    @czantoine
    ok but i need to put this variable. How can I do ?
    Nicolas Charles
    @ncharles
    i'm checking
    czantoine
    @czantoine
    thank you !
    Nicolas Charles
    @ncharles
    if it's only hostname, you can use on of the built-in variable in rudder to get the hostname
    czantoine
    @czantoine
    no it was just an example, i want to do it with other things
    Domagoj Bazina
    @dbazina-dev

    I have one more question :D

    Each generic method has result condition, and there are 3 different cases:

    success
    repaired
    error

    After i run the agent, I can see 3 different "reports":

    compliant

    n/a - not applicable

    error

    repaired

    Is there any connection between these reports? I guess that repaired is when the task is done, compliant is when "state" is equal to desired one, error is self-explanatory?

    Nicolas Charles
    @ncharles
    Yes, success is when it's compliant (all was correct); repaired is something needed to be done to reach desire state, error is for error reports, or non-compliant report (in audit mode)
    Not applicable is when it's not applicable (like a policy for Debian on a RedHat system)
    So, I cannot manage to make it work with a SOMETHING=$(command)
    evaluation of command + evaluation of something that looks like a variable make it too complex to workaround
    HOWEVER, there's a generic method calls Variable string from command that will probably do what you want
    Domagoj Bazina
    @dbazina-dev
    @ncharles thank you :)
    Domagoj Bazina
    @dbazina-dev
    Where can I find deleted technique?
    czantoine
    @czantoine
    clic on technique -> actions -> delete
    Domagoj Bazina
    @dbazina-dev

    Hello guys !
    I wonder, are there any defined variables in rudder server, that can be used in technique-s?
    e.g. Every node has defined Hostname, Node_ID. So can I create technique, that as parameter uses e.g. $(hostname) and on execution for each node it will use hostname or Node_ID defined on Node summary page?

    I know how to define parameter in technique, and then declare it in Directive, but insted of declearing I want to forward that "global variable" defined for each node.

    Nicolas Charles
    @ncharles
    Hello
    This message was deleted
    you have the ${node.inventory[xxx]} values
    Domagoj Bazina
    @dbazina-dev

    @ncharles I've question about adding aditional sources to APT repository.

    Let's say I want to install Docker or some random package, in order to do that I have to complete 2 steps:
    1) Get and add repository GPG key
    2) Add repository to /etc/apt/sources.list.d/

    And on the next update, I can install the package.

    In rudder, I saw two built-in directives:
    1) Directive Package repository keys (RPM/APT)
    2) Package sources and settings (APT)

    The second directive is clear to use, all I have to definre URL of repository, pick distribution and ETC.
    But the first one is kind a tricky.

    I choose to import GPG key, and then there is field "Long hash of the GPG Key". I tought this would be similar directive to the first one, define url of the key, and add it to the trusted.gpg directory.
    But it doesn't work like that.
    It seems to me that I've to manually download the gpg key on the node, then add it to the trusted.gpg directory using output of command "gpg --list-keys --keyid-format=long". When I try that command I get no output.

    So what am I doing wrong here, is there any other way to manage repository GPG keys? Thanks in advance :)

    Nicolas Charles
    @ncharles
    actually you put the gpg key in the directive, and it will automatically accept this key
    Domagoj Bazina
    @dbazina-dev
    In the Package sources and settings (APT) directive? Which field?
    Nicolas Charles
    @ncharles
    no, in Directive Package repository keys (RPM/APT)
    Nicolas E
    @necar_gitlab

    Hello. Today no issue, just a question, so feel free to have a lunch break, relax :)

    I witnessed that some of our newest VMs are now provisioned in a way that sets up /etc/resolv.conf with :

    [legit things...]
    search mydomain1.lan. mydomain2.lan.

    So far so good, but pay attention to the trailing period of each domain.
    So far, I don't remember having ever seen a trailing period at the end of the domains in the search field.
    (please spare your time explaining to me what this period means and how it's use, I'm OK)

    But the link with Rudder is this : I'm witnessing that the inventory process ends up naming this node :
    myserver.mydomain1.lan. <- please note the trailing period
    Our previous nodes did not have a trailing period in their names.

    It happens to ruin some of my groups regexps, which I will fix easily, but I'm curious to learn about how the Rudder node name is built and if this behavior is legit?

    Thanks

    Fdall
    @Fdall

    Hi @necar_gitlab, if I understand well you have some nodes that show an incorrect hostname in their inventory.
    Can you check in the raw inventory of the node (you can find it under the /var/rudder/inventories/received on your root server) the value of the HOSTNAME under the RUDDER section. It should be the hostname of your node with fqdn. As displayed by the output of hostname -f

    Does it seems correct?

    Nicolas Charles
    @ncharles
    HOSTNAME tag in the inventory is the output of hostname --fqdn on linux systems
    Nicolas E
    @necar_gitlab
    OK @ncharles & @Fdall , I'm checking these points to see if all is correct. Thank you.
    Domagoj Bazina
    @dbazina-dev

    Hello everyone :)

    A month ago, I've asked a question about installing packages that are not in standard APT (or some other repository). I've found 2 in-built directives for fetching repository keys, and for creating list in /etc/apt/sources.list.d/

    I was hoping that those directives will execute "apt-update" after adding new repo, but that doesn't happen, they also relay on those global parameters.
    This is not problem for packages that are not defined in standard repository, it will take 10-15 minutes before they get installed (after time defined in global parmater expires and apt-update gets executed).

    But the problem is with the packages that exists in standard repository but in older version.
    e.g. I want to install zabbix-agent, version in APT repository is 5.0, but I want to use 5.4 version.
    I've added repository gpg key, and source file to /etc/apt/sources.list.d/ and If I add "package present directive" for zabbix agent, it will install the older version defined in APT, because apt-updated didn't execute after the key and repo were imported.

    Is there any way to handle this situation? I don't want to set global parameter for apt-update to be executed every 2-3 minutes, and even so the proper version of package won't be installed.

    Thanks

    Nicolas Charles
    @ncharles
    ha - that's a very good point
    the technique that manages the repository ought to do an apt update when repository changes
    could you open a ticket on https://issues.rudder.io/ for this one ?