ansible可安装特定的nodejs版本

y4ekin9u  于 2021-10-10  发布在  Java
关注(0)|答案(0)|浏览(212)

**已关闭。**此问题不符合堆栈溢出准则。它目前不接受答案。
**想要改进此问题?**更新问题,使其位于堆栈溢出主题上。

13小时前关门。
改进这个问题
这是我在anisble中的第一个剧本,我正试图通过ansible安装非常具体的nodejs版本。有人能帮忙吗


# tasks:

    - name: Install the gpg key for nodejs LTS
      apt_key:
        url: "https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
        state: present

    - name: Install the nodejs LTS repos
      apt_repository:
        repo: "deb https://deb.nodesource.com/node_12.x {{ ansible_distribution_release }} main"
        state: present
        update_cache: yes

    - name: Install the nodejs
      apt: name=nodejs=12.19.0 state=present

下面是我的错误,请帮忙。

fatal: [localhost]: FAILED! => {"cache_update_time": 1627213175, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"      install 'nodejs=12.19.0'' failed: E: Version '12.19.0' for 'nodejs' was not found\n", "rc": 100, "stderr": "E: Version '12.19.0' for 'nodejs' was not found\n", "stderr_lines": ["E: Version '12.19.0' for 'nodejs' was not found"], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information..."]}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题