Giter VIP home page Giter VIP logo

Comments (3)

ygalblum avatar ygalblum commented on May 31, 2024 1

Hi @tommyalatalo @lanefu @beechesII
I was about to open an issue on this when I saw this one.
I have a different solution based on the work done in the ansible-consul role: https://github.com/ansible-community/ansible-consul/blob/master/tasks/nix.yml#L58.
I've adjusted this block to nomad by using nomad operator keygen and fetching the existing key from the server.hcl file.

I can open a PR for it to resolve this issue

from ansible-nomad.

beechesII avatar beechesII commented on May 31, 2024

Hi @tommyalatalo , @lanefu ,
i think we maybe can use openssl for automatic creation of nomad_encryption variable as mentioned in the Nomad documentation: https://learn.hashicorp.com/tutorials/nomad/security-gossip-encryption

I wrote a little example playbook for this:

---
- hosts: localhost
  gather_facts: true
  vars:
    nomad_encrypt: ""
  tasks:
    - name: generate nomad_encrypt key with openssl
      shell: "openssl rand -base64 32"
      register: nomad_encrypt_raw
      run_once: true
      when: nomad_encrypt | length == 0

    - name: set nomad_encrypt_raw key as nomad_encrypt
      set_fact:
        nomad_encrypt: "{{ nomad_encrypt_raw.stdout }}"
      run_once: true
      when: nomad_encrypt | length == 0

    - name: create client.hcl.j2
      template:
        src: client.hcl.j2
        dest: client.hcl

Output in File:

$> cat client.hcl
nomad_encrypt = "dB8VaV+KGvp0zxw4RabZqOvVHw8+gw7Ee7KfLUwGBNY="

If you think this might be resolv the issue I can create a Pull Request.

from ansible-nomad.

lanefu avatar lanefu commented on May 31, 2024

@ygalblum great please open PR and tag me in it

from ansible-nomad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.