【问题标题】:How to install PHP7.2 with ansible tower?如何用 ansible tower 安装 PHP7.2?
【发布时间】:2019-04-02 13:49:53
【问题描述】:

当我运行我的 playbook 来安装一些 php 模块时,ansible Tower 会抛出一个错误“无法获取一些档案”。

在机器上运行“sudo apt install”时,我可以自己下载php模块。

“sudo apt-get update”和“sudo apt update”均成功完成更新。

我已经ping通了ubuntu包的ip,并且成功ping通了。

我的剧本

- name: moodle setup
  hosts: all
  become: true

  tasks:

  - name: update server
    apt: update_cache=yes

  - name: Add PHP 7 PPA Repo
    become: true
    apt_repository:
     repo: 'ppa:ondrej/php'

  - name: install git, apache and moodle dependencies
    apt:
     name: "{{ packages }}"
    vars:
     packages:
     - git-core
     - apache2
     - mysql-client
     - mysql-server
     - graphviz
     - aspell
     - ghostscript
     - clamav
     - php7.2-curl
     - php7.2-gd
     - php7.2-intl
     - php7.2-mysql
     - php7.2-xml
     - php7.2-xmlrpc
     - php7.2-ldap
     - php7.2-zip
     - php7.2-soap
     - php7.2-mbstring
     - php7.2-pspell
     - php7.2-cli

我希望 ansible tower 任务返回“已更改”且没有错误。 但我得到这个错误:

E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/x/xmlrpc-epi/libxmlrpc-epi0_0.54.2-1.1ubuntu0.1_amd64.deb  Connection failed [IP: 142.182.19.17 8083]\n\nE: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?\n",
    "rc": 100,
    "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"     install 'php7.2-curl' 'php7.2-gd' 'php7.2-intl' 'php7.2-mysql' 'php7.2-xml' 'php7.2-xmlrpc' 'php7.2-ldap' 'php7.2-zip' 'php7.2-soap' 'php7.2-mbstring' 'php7.2-pspell' 'php7.2-cli'' failed: E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/x/xmlrpc-epi/libxmlrpc-epi0_0.54.2-1.1ubuntu0.1_amd64.deb  Connection failed [IP: 142.182.19.17 8083]\n\nE: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?\n


....


"Get:22 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 php7.2-zip amd64 7.2.16-1+ubuntu16.04.1+deb.sury.org+1 [20.3 kB]",
        "Err:23 http://security.ubuntu.com/ubuntu xenial-security/main amd64 libxmlrpc-epi0 amd64 0.54.2-1.1ubuntu0.1",
        "  Connection failed [IP: 142.182.19.17 8083]",
        "Err:23 http://security.ubuntu.com/ubuntu xenial-security/main amd64 libxmlrpc-epi0 amd64 0.54.2-1.1ubuntu0.1",
        "  Connection failed [IP: 142.182.19.17 8083]",
        "Fetched 5529 kB in 8min 0s (11.5 kB/s)"

【问题讨论】:

    标签: ansible ansible-tower


    【解决方案1】:

    我今天在安装软件包时遇到了困难,我认为这是 security.ubuntu.com 的问题 - https://twitter.com/JaxxAI/status/1113064122638249986

    这可能与您的问题有关。

    【讨论】:

    • 我昨天遇到了同样的问题,但这个问题是 ansible 尝试安装软件包。我可以手动安装软件包没问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-06-24
    • 2020-08-15
    • 1970-01-01
    • 2021-09-01
    • 2018-11-13
    • 2023-03-24
    相关资源
    最近更新 更多