PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, October 9, 2022

[FIXED] How to create an ansible task to update golang

 October 09, 2022     ansible, continuous-integration, go, yaml     No comments   

Issue

I want to update golang version to the latest in some dev servers, and I wanted to add a task for this. I was thinking of doing something like this-

- name: Upgrade golang
  ansible.builtin.yum:
    name: 'golang'
    state: latest

but Im not sure if this would work, plus I dont think if writing "golang" in the name section is enough. Could you please suggest what this task should look like if I just want to update golang to the latest


Solution

state: latest will update the specified package if it’s not of the latest available version (see Ansible Docs: yum module). Your task should work. For name you have to write the package name, as you used for installation.

If you want to update other packages that are not themselves a dependency of golang, you must specify them separately. Packages that golang depends on are automatically resolved and installed by yum.

If you want to specify multiple packages, you can pass them as a list to for name. For example:

- name: Upgrade golang
  ansible.builtin.yum:
    name:
      - golang
      - golang-docker-dev
      - golang-collectd-dev
    state: latest


Answered By - phanaz
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing