saltstack-formulas / php-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
57 stars 232 forks source link

[BUG] formula always installs apache2 #220

Closed sebastianreloaded closed 3 years ago

sebastianreloaded commented 3 years ago

Your setup

Formula commit hash / release tag

v1.3.1

Versions reports (master & minion)

Salt Version: Salt: 3001.3

Dependency Versions: cffi: Not Installed cherrypy: Not Installed dateutil: 2.6.1 docker-py: Not Installed gitdb: 2.0.3 gitpython: 2.1.8 Jinja2: 2.10 libgit2: 0.26.0 M2Crypto: Not Installed Mako: Not Installed msgpack-pure: Not Installed msgpack-python: 0.5.6 mysql-python: Not Installed pycparser: Not Installed pycrypto: Not Installed pycryptodome: 3.4.7 pygit2: 0.26.2 Python: 3.6.9 (default, Oct 8 2020, 12:12:24) python-gnupg: 0.4.1 PyYAML: 3.12 PyZMQ: 17.1.2 smmap: 2.0.3 timelib: Not Installed Tornado: 4.5.3 ZMQ: 4.2.5

System Versions: dist: ubuntu 18.04 Bionic Beaver locale: UTF-8 machine: x86_64 release: 5.4.0-1031-azure system: Linux version: Ubuntu 18.04 Bionic Beaver

Pillar / config used

php:
  # set the version of php to be used
  version: "7.2"
  # can be a list of versions :
  # version:
  #   - "7.3"
  #   - "7.2"

  # php-fpm settings
  fpm:

    # settings for the php-fpm service
    service:
      # if true, enables the php-fpm service, if false disables it
      enabled: true
      # additional arguments passed forward to
      # service.enabled/disabled
      opts:
        reload: true

    # settings for fpm-pools
    pools:
      # defaults will apply for each pools settings and can be overwritten
      # by pool settings
      defaults:
        user: www-data
        group: www-data
        listen: /var/run/php-fpm-default.sock

  use_apache_formula: false # important to avoid installation of apache

  # List of modules to install via php.modules
  modules:
    # Calls `php.<name>` if available, or try to install the matching
    # packages that can be set via from php:lookup:pkgs
    - cli
    - fpm
    - curl
    - mysql
    - apcu
    - soap
    - xml
    - mbstring
    - gd 

Bug details

Describe the bug

apache2 is installed.

Expected behaviour

Do not install apache2. I use the nginx-formula as a webserver.

sebastianreloaded commented 3 years ago

Ok, i was not supposed to include the php-state, only php-fpm and php-modules. The php-state will install apache2

SkypLabs commented 6 months ago

I'm hitting the same issue with salt-ssh in version 3007.0 and php-formula in version v1.6.0. I have set use_apache_formula to false but Apache2 is still installed.

The problem seems to come from install_recommends of the pkg.installed Salt state which defaults to True:

debian@wordpress-1:~$ sudo aptitude why apache2
i   php7.4                Depends    libapache2-mod-php7.4 | php7.4-fpm | php7.4-cgi
i A libapache2-mod-php7.4 Recommends apache2

The apache2 package is installed automatically because it is recommended by libapache2-mod-php7.4.