Code Monkey home page Code Monkey logo

Comments (4)

kyleabenson avatar kyleabenson commented on August 11, 2024

@tbludau There is some good work that can be done here.. Both in specific tasks and structure.

Many of these tasks where the shell or command modules are being used for subscriptions can be remediated using either the redhat_subscription or yum_repository modules.

As far as structure we should be able to reduce some of these plays by enforcing a desired state around subscriptions rather than doing checking like so:

- name: Reset all previous repositories
  shell: |
    subscription-manager repos --disable="*"
    num=0
    for r in /etc/yum.repos.d/*.repo; do
      num=$(( num + $(grep  -c "^enabled.*=.*1$" $r) ))
      sed -i 's/^enabled.*=.*1/enabled = 0/g' $r
    done
    echo "$num"
  register: repo_cleanup
  changed_when: repo_cleanup.stdout > 0
  failed_when: repo_cleanup.rc > 0
  when: force_repo_reset

We shouldn't need to do loops in tasks for each repo, the yum_repository module should be able to disable all repos. We should also try to get to a state with this role assuming that we either want to force a repo reset every time or not before this task.

If there are instances where the answer is 'it depends' we should try to be more selective in resolving repo conflicts

Lastly, I think we can restructure the suggest roles into either 'self-configured' or 'subscription-based'. We should be able to perform a couple of tasks based on wether a Sat 6 URL var is present or not, then proceed as normal.

Thoughts?

from ansible-hana-examples.

kyleabenson avatar kyleabenson commented on August 11, 2024

@tbludau I think we can close this task -- there is a lot of cleanup to be done in issue #13 so I can resolve some of these.

from ansible-hana-examples.

kyleabenson avatar kyleabenson commented on August 11, 2024

@tbludau question.. are we setting a strict level on ansible version? There's currently a new rhsm_repository module in the development stream for ansible 2.5 that might clean up some of this too.

from ansible-hana-examples.

tbludau avatar tbludau commented on August 11, 2024

hey @kyleabenson thanks for your input and sorry for my delayed response. as you descibed we can close this case, because it should not be part of the ansible deployment and brings a lot of erros in aws and azure environments.

from ansible-hana-examples.

Related Issues (14)

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.