Git Product home page Git Product logo

Comments (3)

ansibot avatar ansibot commented on June 14, 2024

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the component bot command.

from ansible.

s-hertel avatar s-hertel commented on June 14, 2024

Hi!

Thanks very much for your submission to Ansible. It means a lot to us that you've taken time to contribute.

Unfortunately, we're not sure if we want this feature in the program, and I don't want this to seem confrontational.
Our reasons for this are:

However, we're absolutely always up for discussion.
Because this project is very active, we're unlikely to see comments made on closed tickets and we lock them after some time.
If you or anyone else has any further questions, please let us know by using any of the communication methods listed in the page below:

In the future, sometimes starting a discussion on the development list prior to implementing a feature can make getting things included a little easier, but it's not always necessary.

Thank you once again for this and your interest in Ansible!

from ansible.

rgaufman avatar rgaufman commented on June 14, 2024

That's fair, but after close to a decade using Ansible to manage over a thousand servers, this was just 1 too many callbacks on top of other hacks, workarounds and frustrations.

We ended up creating our own solution which gave us these advantages:

  • 11x fewer lines (35k lines of yml recipes down to 3k of clean/concise Ruby DSL)
  • 35x faster to run (from 20 minutes with Ansible to around 34 seconds with Ruby)
  • readable log output, easier profiling
  • automatically creating backup files if a file changed
  • ability to set timeouts and retries on tasks, etc
  • other clever things like if a task is running for >5 min, it will log "Command still running:" with the command in question

Here is an example of the output, showing only the changes being made, with clear timestamps and durations. In contrast to having countless pages of difficult to parse Ansible output, not knowing what is currently running or when previous tasks were completed:

Screenshot 2024-04-22 at 01 24 33

The recipes are much more concise, for example:

# note, the secret_key_base is generated in the erb template
template(secrets_path, 'secrets.sample.yml', mode: '644', user: 'deployer:deployer', overwrite: false)

Instead of:

- name: Check if secrets yml already exists
  ansible.builtin.stat:
    path: "{{ deploy_to }}/config/secrets.yml"
  register: tetherbox_secrets_yml

- name: Generate Rails secret_key_base
  ansible.builtin.command:
    cmd: "openssl rand -hex 64"
  register: secret_key_base
  changed_when: false
  when: tetherbox_secrets_yml.stat.exists is false

- name: Create secrets yml
  ansible.builtin.template:
    src: 'secrets.yml.j2'
    dest: "{{ deploy_to }}/config/secrets.yml"
    mode: '0644'
    owner: '{{ username }}'
    group: '{{ username }}'
  when: tetherbox_secrets_yml.stat.exists is false

We will do a bit more testing and refining and will release this as open source as an alternative to those that want something a bit more opinionated and out of the box, without needing to do callbacks/hacks for basics like standard log output.

from ansible.

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.