如何用ansible塔安装PHP7.2?

时间:2019-04-02 13:49:54

标签: ansible ansible-tower

当我运行我的剧本以安装一些php模块时,ansible塔引发错误“无法获取一些档案”。

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

“ sudo apt-get更新”和“ sudo apt更新”都成功完成了更新。

我已经对ubuntu软件包的ip进行了ping操作,并成功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塔任务返回“已更改”且没有错误。 但是我得到这个错误:

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)"

1 个答案:

答案 0 :(得分:0)

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

这可能与您的问题有关。