FAQ
Ok so it only seems to work if I explicitly have the php5 declaration in
the same state file scope. I guess the concept of package is a psudo
concept used within salts internal scope? Rather than being taken from
looking at the machine file system etc?

# ~~~
# Installs utilities

utils:
   pkg:
     - installed
     - names:
       - vim
       - htop
       - screen
       - curl

# ~~~
# Installs and watches php5-fpm

php5:
   pkg:
     - installed
     - names:
       - php5
       - php5-mysql
       - php5-cli
       - php5-curl
       - php5-mcrypt
       - php5-xmlrpc
       - php5-gd
       - php5-imagick

php5-fpm:
   pkg:
     - installed
   service:
     - running
     - enable: true
     - watch:
       - file: /etc/php5/fpm/conf.d/digedu.ini
       - file: /etc/php5/fpm/pool.d/www.conf
     - require:
       - pkg: php5-fpm

/etc/php5/cli/conf.d/digedu.ini:
   file.managed:
     - source: salt://cloud-local/etc/php5/cli/conf.d/digedu.ini

/etc/php5/fpm/conf.d/digedu.ini:
   file.managed:
     - source: salt://cloud-local/etc/php5/fpm/conf.d/digedu.ini

/etc/php5/fpm/pool.d/www.conf:
   file.managed:
     - source: salt://cloud-local/etc/php5/fpm/pool.d/www.conf

# ~~~
# Installs and watches composer

get-composer:
   cmd.run:
     - name: curl -sS https://getcomposer.org/installer | php
     - unless: test -f /usr/local/bin/composer
     - cwd: /root/
     - require:
       - pkg: curl
       - pkg: php5

install-composer:
   cmd.wait:
     - name: mv /root/composer.phar /usr/local/bin/composer
     - cwd: /root/
     - watch:
       - cmd: get-composer

/var/www/api:
   composer.installed:
     - no_dev: true
     - require:
       - cmd: install-composer




On Tuesday, July 8, 2014 10:42:43 AM UTC-7, Justin Vincent wrote:

Pulling hair out here!

For some reason salt won't try ti install composer because it says that
curl and php5 requirements are not being met... yet when I
use pkg.list_pkgs they are on the machine.

All help much appreciated!

*Salt state file...*

# ~~~
# Installs utilities

utils:
pkg:
- installed
- names:
- vim
- htop
- screen
- curl

# ~~~
# Installs and watches composer

get-composer:
cmd.run:
- name: curl -sS https://getcomposer.org/installer | php
- unless: test -f /usr/local/bin/composer
- cwd: /root/
- require:
- pkg: curl
- pkg: php5

install-composer:
cmd.wait:
- name: mv /root/composer.phar /usr/local/bin/composer
- cwd: /root/
- watch:
- cmd: get-composer

/var/www/api:
composer.installed:
- no_dev: true
- require:
- cmd: install-composer

*Salt master output...*

cloud-local-justin:
----------
ID: get-composer
Function: cmd.run
Name: curl -sS https://getcomposer.org/installer | php
Result: False
Comment: The following requisites were not found:
require:
pkg: php5
Changes:
----------
ID: utils
Function: pkg.installed
Name: screen
Result: True
Comment: Package screen is already installed
Changes:
----------
ID: install-composer
Function: cmd.wait
Name: mv /root/composer.phar /usr/local/bin/composer
Result: False
Comment: One or more requisite failed
Changes:
----------
ID: utils
Function: pkg.installed
Name: htop
Result: True
Comment: Package htop is already installed
Changes:
----------
ID: /var/www/api
Function: composer.installed
Result: False
Comment: One or more requisite failed
Changes:
----------
ID: utils
Function: pkg.installed
Name: curl
Result: True
Comment: Package curl is already installed
Changes:
----------
ID: utils
Function: pkg.installed
Name: vim
Result: True
Comment: Package vim is already installed
Changes:

Summary
------------
Succeeded: 4
Failed: 3
------------
Total: 7

*BUT the pkgs ARE installed...*

salt "cloud-local-justin" pkg.list_pkgs

curl:

7.22.0-3ubuntu4.8

curl-ssl:

1

php5:

5.3.10-1ubuntu3.12

php5-cli:

5.3.10-1ubuntu3.12

php5-common:

5.3.10-1ubuntu3.12

php5-curl:

5.3.10-1ubuntu3.12

php5-fpm:

5.3.10-1ubuntu3.12

php5-gd:

5.3.10-1ubuntu3.12

php5-imagick:

3.1.0~rc1-1

php5-json:

1

php5-mcrypt:

5.3.5-0ubuntu1

php5-mhash:

1

php5-mysql:

5.3.10-1ubuntu3.12

php5-xmlrpc:

5.3.10-1ubuntu3.12
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 6 | next ›
Discussion Overview
groupsalt-users @
postedJul 8, '14 at 5:42p
activeJul 9, '14 at 12:41a
posts6
users4

People

Translate

site design / logo © 2022 Grokbase