因此,我有一个基本的来安装和配置一个应用程序--在本例中是进水数据库。但是,我希望salt能够管理块设备的安装,并在运行之前通过应用程序获得required。
/opt/influxdb/shared/data/db:
mount.mounted:
- device: /dev/vdb1
- fstype: ext4
- mkmnt: True
- opts:
- defaults
influxdb:
pkg.installed:
- sources:
- influxdb: salt://influxdb/influxdb-0.8.8-1.x86_64.rpm
service.running:
- require:
- pkg: influxdb
- watch:
- file: /opt/influxdb/current/config.toml
module.run:
- name: influxdb.db_create
- m_name: test_db
/opt/influxdb/current/config.toml:
file.managed:
- name: /opt/influxdb/current/config.toml
- template: jinja
- source:
- salt://ptolemy/influxdb.toml
python-pip:
pkg.installed
influxdb-python:
pip.installed:
- name: influxdb
- require:
- pkg: python-pip我想我会想要一些在service.running下influxdb下的东西。有人能帮忙吗?
发布于 2015-06-07 14:56:44
您需要在require下面添加一个新属性,并列出其他需求。它应该是这样的:
influxdb:
pkg.installed:
- sources:
- influxdb: salt://influxdb/influxdb-0.8.8-1.x86_64.rpm
service.running:
- require:
- pkg: influxdb
- mount: /opt/influxdb/shared/data/db
- watch:
- file: /opt/influxdb/current/config.toml有关require:http://docs.saltstack.com/en/latest/ref/states/requisites.html的文档,请参见此处
https://stackoverflow.com/questions/27808464
复制相似问题