https://www.puppet.com/community logo
Join Slack
Powered by
# puppet
  • w

    William Myers

    10/25/2022, 11:33 PM
    I've been executing this against Ubuntu 20.04 LTS
  • n

    natemccurdy

    10/25/2022, 11:33 PM
    Note that passwords for linux user accounts shouldn’t be the plaintext password. But should be the hashed/salted form of the password.
  • w

    William Myers

    10/25/2022, 11:34 PM
    ahhhhhhhhhh
  • w

    William Myers

    10/25/2022, 11:35 PM
    ah ok, I see that when I go to the user type on puppet.
  • w

    William Myers

    10/25/2022, 11:37 PM
    Thank you, wasn't mentioned in the Account Module (I guess It's assumed someone's already aware of that caveat)
  • w

    William Myers

    10/25/2022, 11:57 PM
    How can I verify eyaml properties are being properly decrypted?
  • g

    Greg Bristol

    10/25/2022, 11:58 PM
    i usually use
    puppet lookup
    on a puppetmaster
  • n

    natemccurdy

    10/25/2022, 11:58 PM
    Yup,
    puppet lookup
    from the command line or just a
    notify
    resource in your code that prints out the value.
  • w

    William Myers

    10/25/2022, 11:59 PM
    could you provide an example that would print out the value for $user_password /
  • g

    Greg Bristol

    10/26/2022, 12:00 AM
    sudo puppet lookup account_svcansiblelocal::user_password
  • n

    natemccurdy

    10/26/2022, 12:00 AM
    Copy code
    notify { 'user_password':
      message => "The user_password is: ${user_password}",
    }
  • g

    Greg Bristol

    10/26/2022, 12:00 AM
    you might need to specify
    --node
    or
    --environment
    depending
  • w

    William Myers

    10/26/2022, 12:00 AM
    thanks! now to debug
  • w

    William Myers

    10/26/2022, 12:01 AM
    oof yeah, it's not decrypting the values.
  • w

    William Myers

    10/26/2022, 12:01 AM
    here's my site level hiera.yaml
    Copy code
    ---
    version: 5
    
    defaults:
      datadir: "hieradata"
    
    hierarchy:
      - name: "Yaml backend"
        data_hash: yaml_data
        paths:
          - "nodes/%{trusted.certname}.yaml"
          - "common.yaml"
      - name: "EYaml Backend"
        lookup_key: eyaml_lookup_key # eyaml backend
        paths: 
          - 'secrets.eyaml'
        options:
          pkcs7_private_key: /etc/puppetlabs/puppet/keys/private_key.pkcs7.pem 
          pkcs7_public_key: /etc/puppetlabs/puppet/keys/public_key.pkcs7.pem
  • d

    Dr Bunsen Honeydew

    10/26/2022, 12:01 AM
    ```- took a hit! Ouch. (Karma: -85)
  • w

    William Myers

    10/26/2022, 12:02 AM
    module level
    Copy code
    ---
    version: 5
    
    defaults:  # Used for any hierarchy level that omits these keys.
      datadir: data         # This path is relative to hiera.yaml's directory.
      data_hash: yaml_data  # Use the built-in YAML backend.
    
    hierarchy:
      - name: "osfamily/major release"
        paths:
            # Used to distinguish between Debian and Ubuntu
          - "os/%{facts.os.name}/%{facts.os.release.major}.yaml"
          - "os/%{facts.os.family}/%{facts.os.release.major}.yaml"
            # Used for Solaris
          - "os/%{facts.os.family}/%{facts.kernelrelease}.yaml"
      - name: "osfamily"
        paths:
          - "os/%{facts.os.name}.yaml"
          - "os/%{facts.os.family}.yaml"
      - name: 'common'
        path: 'common.yaml'
  • d

    Dr Bunsen Honeydew

    10/26/2022, 12:02 AM
    ```- lost a life. (Karma: -86)
  • n

    natemccurdy

    10/26/2022, 12:02 AM
    sudo puppet lookup account_svcansiblelocal::user_password --node <http://vmpuppetmaster01.britanniahome.net|vmpuppetmaster01.britanniahome.net> --environment test --explain
  • w

    William Myers

    10/26/2022, 12:02 AM
    -_- first time I closed with backticks, second time I diddn't
  • n

    natemccurdy

    10/26/2022, 12:02 AM
    What does the encrypted data look like in
    secrets.yaml
  • w

    William Myers

    10/26/2022, 12:02 AM
    Site level is null
  • g

    Greg Bristol

    10/26/2022, 12:03 AM
    yeah
    --explain
    can help a ton here
  • w

    William Myers

    10/26/2022, 12:03 AM
    Error: Could not run: No facts available for target node: vmpuppetmaster01.britanniahome.net
  • n

    natemccurdy

    10/26/2022, 12:03 AM
    Your encrypted secret has to exist in the environment-level
    secrets.eyaml
    file for it to be decrypted (based on your Hiera config)
  • n

    natemccurdy

    10/26/2022, 12:04 AM
    Your encrypted secret has to exist in the environment-level
    secrets.yaml
    file for it to be decrypted
  • n

    natemccurdy

    10/26/2022, 12:04 AM
    Your encrypted secret has to exist in the environment-level
    secrets.yaml
    file for it to be decrypted (based on your Hiera config)
  • g

    Greg Bristol

    10/26/2022, 12:04 AM
    yeah you'll need to adjust that node option to have a hostname of a node that's puppetized from this puppet primary server in the past
  • n

    natemccurdy

    10/26/2022, 12:04 AM
    Try just
    sudo puppet lookup account_svcansiblelocal::user_password --environment test --explain
  • n

    natemccurdy

    10/26/2022, 12:04 AM
    Try just
    sudo puppet lookup account_svcansiblelocal::user_password --environment test --explain
1...215216217...428Latest