aws-iam-authenticator install via ansible2019 Community Moderator ElectionAnsible - Download latest release binary from Github repoSafely limiting Ansible playbooks to a single machine?Run command on the Ansible hostHow to get the host name of the current machine as defined in the Ansible hosts file?Specify sudo password for AnsibleHow to create a directory using AnsibleHow to move/rename a file using an Ansible task on a remote systemansible: lineinfile for several lines?How to ignore ansible SSH authenticity checking?The async task did not return valid JSONAnsible Module to list iam users?

Determine voltage drop over 10G resistors with cheap multimeter

Friend wants my recommendation but I don't want to give it to him

Animating wave motion in water

What kind of footwear is suitable for walking in micro gravity environment?

How do you justify more code being written by following clean code practices?

Why are there no stars visible in cislunar space?

Should a narrator ever describe things based on a characters view instead of fact?

How can a new country break out from a developed country without war?

Why is indicated airspeed rather than ground speed used during the takeoff roll?

Homology of the fiber

Why do I have a large white artefact on the rendered image?

How to test the sharpness of a knife?

Have the tides ever turned twice on any open problem?

Would this string work as string?

Would mining huge amounts of resources on the Moon change its orbit?

How to read string as hex number in bash?

How to determine the greatest d orbital splitting?

Imaginary part of expression too difficult to calculate

Does convergence of polynomials imply that of its coefficients?

Do I need an EFI partition for each 18.04 ubuntu I have on my HD?

Asserting that Atheism and Theism are both faith based positions

Does the Shadow Magic sorcerer's Eyes of the Dark feature work on all Darkness spells or just his/her own?

When did hardware antialiasing start being available?

How to balance a monster modification (zombie)?



aws-iam-authenticator install via ansible



2019 Community Moderator ElectionAnsible - Download latest release binary from Github repoSafely limiting Ansible playbooks to a single machine?Run command on the Ansible hostHow to get the host name of the current machine as defined in the Ansible hosts file?Specify sudo password for AnsibleHow to create a directory using AnsibleHow to move/rename a file using an Ansible task on a remote systemansible: lineinfile for several lines?How to ignore ansible SSH authenticity checking?The async task did not return valid JSONAnsible Module to list iam users?










0















Looking how to translate (properly) from a bash command (orig inside a Dockerfile) to ansible task/role that will download latest aws-iam-authenticator binary and install into /usr/local/bin on Ubuntu (x64) OS.



currently I have:



curl -s https://api.github.com/repos/kubernetes-sigs/aws-iam-authenticator/releases/latest | grep "browser_download.url.*linux_amd64" | cut -d : -f 2,3 | tr -d '"' | wget -O /usr/local/bin/aws-iam-authenticator -qi - && chmod 555 /usr/local/bin/aws-iam-authenticator










share|improve this question






















  • I have updated the answer with a working example

    – Hernan Garcia
    Mar 7 at 21:13















0















Looking how to translate (properly) from a bash command (orig inside a Dockerfile) to ansible task/role that will download latest aws-iam-authenticator binary and install into /usr/local/bin on Ubuntu (x64) OS.



currently I have:



curl -s https://api.github.com/repos/kubernetes-sigs/aws-iam-authenticator/releases/latest | grep "browser_download.url.*linux_amd64" | cut -d : -f 2,3 | tr -d '"' | wget -O /usr/local/bin/aws-iam-authenticator -qi - && chmod 555 /usr/local/bin/aws-iam-authenticator










share|improve this question






















  • I have updated the answer with a working example

    – Hernan Garcia
    Mar 7 at 21:13













0












0








0








Looking how to translate (properly) from a bash command (orig inside a Dockerfile) to ansible task/role that will download latest aws-iam-authenticator binary and install into /usr/local/bin on Ubuntu (x64) OS.



currently I have:



curl -s https://api.github.com/repos/kubernetes-sigs/aws-iam-authenticator/releases/latest | grep "browser_download.url.*linux_amd64" | cut -d : -f 2,3 | tr -d '"' | wget -O /usr/local/bin/aws-iam-authenticator -qi - && chmod 555 /usr/local/bin/aws-iam-authenticator










share|improve this question














Looking how to translate (properly) from a bash command (orig inside a Dockerfile) to ansible task/role that will download latest aws-iam-authenticator binary and install into /usr/local/bin on Ubuntu (x64) OS.



currently I have:



curl -s https://api.github.com/repos/kubernetes-sigs/aws-iam-authenticator/releases/latest | grep "browser_download.url.*linux_amd64" | cut -d : -f 2,3 | tr -d '"' | wget -O /usr/local/bin/aws-iam-authenticator -qi - && chmod 555 /usr/local/bin/aws-iam-authenticator







amazon-web-services ansible






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 7 at 18:58









JKDayJKDay

1




1












  • I have updated the answer with a working example

    – Hernan Garcia
    Mar 7 at 21:13

















  • I have updated the answer with a working example

    – Hernan Garcia
    Mar 7 at 21:13
















I have updated the answer with a working example

– Hernan Garcia
Mar 7 at 21:13





I have updated the answer with a working example

– Hernan Garcia
Mar 7 at 21:13












2 Answers
2






active

oldest

votes


















0














Basically you need to write a playbook and separate that command in various tasks



Example example.yml file



- hosts: localhost
tasks:
- shell: |
curl -s https://api.github.com/repos/kubernetes-sigs/aws-iam-authenticator/releases/latest
register: json
- set_fact:
url: " from_json).assets[2].browser_download_url "
- get_url:
url: " url "
dest: /usr/local/bin/aws-iam-authenticator-ansible
mode: 0555


you can execute it by doing



ansible-playbook --become example.yml


I hope this is what you're looking for ;-)






share|improve this answer

























  • Thanks for the information you provided. The only issue I see is that I can't guarantee that the browser_url_download is always the 3rd entry [2] in the array. I've posted my answer to alleviate that issue after a lot of research.

    – JKDay
    Mar 8 at 3:29


















0














So after finding other posts that gave strong hints, information and unresolved issues, Ansible - Download latest release binary from Github repo & https://github.com/ansible/ansible/issues/27299#issuecomment-331068246. I was able to come up with the following ansible task that works for me.



 - name: Get latest url for linux-amd64 release for aws-iam-authenticator
uri:
url: https://api.github.com/repos/kubernetes-sigs/aws-iam-authenticator/releases/latest
return_content: true
body_format: json
register: json_response

- name: Download and install aws-iam-authenticator
get_url:
url: " from_json"
mode: 555
dest: /usr/local/bin/aws-iam-authenticator





share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55050984%2faws-iam-authenticator-install-via-ansible%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Basically you need to write a playbook and separate that command in various tasks



    Example example.yml file



    - hosts: localhost
    tasks:
    - shell: |
    curl -s https://api.github.com/repos/kubernetes-sigs/aws-iam-authenticator/releases/latest
    register: json
    - set_fact:
    url: " from_json).assets[2].browser_download_url "
    - get_url:
    url: " url "
    dest: /usr/local/bin/aws-iam-authenticator-ansible
    mode: 0555


    you can execute it by doing



    ansible-playbook --become example.yml


    I hope this is what you're looking for ;-)






    share|improve this answer

























    • Thanks for the information you provided. The only issue I see is that I can't guarantee that the browser_url_download is always the 3rd entry [2] in the array. I've posted my answer to alleviate that issue after a lot of research.

      – JKDay
      Mar 8 at 3:29















    0














    Basically you need to write a playbook and separate that command in various tasks



    Example example.yml file



    - hosts: localhost
    tasks:
    - shell: |
    curl -s https://api.github.com/repos/kubernetes-sigs/aws-iam-authenticator/releases/latest
    register: json
    - set_fact:
    url: " from_json).assets[2].browser_download_url "
    - get_url:
    url: " url "
    dest: /usr/local/bin/aws-iam-authenticator-ansible
    mode: 0555


    you can execute it by doing



    ansible-playbook --become example.yml


    I hope this is what you're looking for ;-)






    share|improve this answer

























    • Thanks for the information you provided. The only issue I see is that I can't guarantee that the browser_url_download is always the 3rd entry [2] in the array. I've posted my answer to alleviate that issue after a lot of research.

      – JKDay
      Mar 8 at 3:29













    0












    0








    0







    Basically you need to write a playbook and separate that command in various tasks



    Example example.yml file



    - hosts: localhost
    tasks:
    - shell: |
    curl -s https://api.github.com/repos/kubernetes-sigs/aws-iam-authenticator/releases/latest
    register: json
    - set_fact:
    url: " from_json).assets[2].browser_download_url "
    - get_url:
    url: " url "
    dest: /usr/local/bin/aws-iam-authenticator-ansible
    mode: 0555


    you can execute it by doing



    ansible-playbook --become example.yml


    I hope this is what you're looking for ;-)






    share|improve this answer















    Basically you need to write a playbook and separate that command in various tasks



    Example example.yml file



    - hosts: localhost
    tasks:
    - shell: |
    curl -s https://api.github.com/repos/kubernetes-sigs/aws-iam-authenticator/releases/latest
    register: json
    - set_fact:
    url: " from_json).assets[2].browser_download_url "
    - get_url:
    url: " url "
    dest: /usr/local/bin/aws-iam-authenticator-ansible
    mode: 0555


    you can execute it by doing



    ansible-playbook --become example.yml


    I hope this is what you're looking for ;-)







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 7 at 21:13

























    answered Mar 7 at 20:17









    Hernan GarciaHernan Garcia

    565315




    565315












    • Thanks for the information you provided. The only issue I see is that I can't guarantee that the browser_url_download is always the 3rd entry [2] in the array. I've posted my answer to alleviate that issue after a lot of research.

      – JKDay
      Mar 8 at 3:29

















    • Thanks for the information you provided. The only issue I see is that I can't guarantee that the browser_url_download is always the 3rd entry [2] in the array. I've posted my answer to alleviate that issue after a lot of research.

      – JKDay
      Mar 8 at 3:29
















    Thanks for the information you provided. The only issue I see is that I can't guarantee that the browser_url_download is always the 3rd entry [2] in the array. I've posted my answer to alleviate that issue after a lot of research.

    – JKDay
    Mar 8 at 3:29





    Thanks for the information you provided. The only issue I see is that I can't guarantee that the browser_url_download is always the 3rd entry [2] in the array. I've posted my answer to alleviate that issue after a lot of research.

    – JKDay
    Mar 8 at 3:29













    0














    So after finding other posts that gave strong hints, information and unresolved issues, Ansible - Download latest release binary from Github repo & https://github.com/ansible/ansible/issues/27299#issuecomment-331068246. I was able to come up with the following ansible task that works for me.



     - name: Get latest url for linux-amd64 release for aws-iam-authenticator
    uri:
    url: https://api.github.com/repos/kubernetes-sigs/aws-iam-authenticator/releases/latest
    return_content: true
    body_format: json
    register: json_response

    - name: Download and install aws-iam-authenticator
    get_url:
    url: " from_json"
    mode: 555
    dest: /usr/local/bin/aws-iam-authenticator





    share|improve this answer



























      0














      So after finding other posts that gave strong hints, information and unresolved issues, Ansible - Download latest release binary from Github repo & https://github.com/ansible/ansible/issues/27299#issuecomment-331068246. I was able to come up with the following ansible task that works for me.



       - name: Get latest url for linux-amd64 release for aws-iam-authenticator
      uri:
      url: https://api.github.com/repos/kubernetes-sigs/aws-iam-authenticator/releases/latest
      return_content: true
      body_format: json
      register: json_response

      - name: Download and install aws-iam-authenticator
      get_url:
      url: " from_json"
      mode: 555
      dest: /usr/local/bin/aws-iam-authenticator





      share|improve this answer

























        0












        0








        0







        So after finding other posts that gave strong hints, information and unresolved issues, Ansible - Download latest release binary from Github repo & https://github.com/ansible/ansible/issues/27299#issuecomment-331068246. I was able to come up with the following ansible task that works for me.



         - name: Get latest url for linux-amd64 release for aws-iam-authenticator
        uri:
        url: https://api.github.com/repos/kubernetes-sigs/aws-iam-authenticator/releases/latest
        return_content: true
        body_format: json
        register: json_response

        - name: Download and install aws-iam-authenticator
        get_url:
        url: " from_json"
        mode: 555
        dest: /usr/local/bin/aws-iam-authenticator





        share|improve this answer













        So after finding other posts that gave strong hints, information and unresolved issues, Ansible - Download latest release binary from Github repo & https://github.com/ansible/ansible/issues/27299#issuecomment-331068246. I was able to come up with the following ansible task that works for me.



         - name: Get latest url for linux-amd64 release for aws-iam-authenticator
        uri:
        url: https://api.github.com/repos/kubernetes-sigs/aws-iam-authenticator/releases/latest
        return_content: true
        body_format: json
        register: json_response

        - name: Download and install aws-iam-authenticator
        get_url:
        url: " from_json"
        mode: 555
        dest: /usr/local/bin/aws-iam-authenticator






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 8 at 3:33









        JKDayJKDay

        1




        1



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55050984%2faws-iam-authenticator-install-via-ansible%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

            Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

            2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived