50a310f5c7
The cloud-init should use the same filenames for the rsyslog remote logging as used in the fuel-library templates which would be overwritten during the deployment by the puppet. This is partially fix the problem with duplicate messages sent from slave nodes to the Fuel master node rsyslog. Change-Id: Ib95db5545889e8ae2b86dcf787c4adb7413d5698 Partial-Bug: #1579081 Partial-Bug: #1580200 Signed-off-by: Maksim Malchuk <mmalchuk@mirantis.com>
121 lines
3.2 KiB
Django/Jinja
121 lines
3.2 KiB
Django/Jinja
#cloud-config
|
|
resize_rootfs: false
|
|
growpart:
|
|
mode: false
|
|
disable_ec2_metadata: true
|
|
disable_root: false
|
|
users:
|
|
{% for user in user_accounts %}
|
|
- name: {{ user.name }}
|
|
passwd: {{ user.hashed_password }}
|
|
lock_passwd: False
|
|
homedir: {{ user.homedir }}
|
|
shell: {{ user.shell }}
|
|
{% if user.ssh_keys|length > 0 %}
|
|
ssh_authorized_keys:
|
|
{% for key in user.ssh_keys %}
|
|
- {{ key }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% if user.sudo|length > 0 %}
|
|
sudo:
|
|
{% for entry in user.sudo %}
|
|
- "{{ entry }}"
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
chpasswd: { expire: false }
|
|
ssh_pwauth: false
|
|
|
|
# set the locale to a given locale
|
|
# default: en_US.UTF-8
|
|
locale: en_US.UTF-8
|
|
|
|
timezone: {{ common.timezone }}
|
|
|
|
hostname: {{ common.hostname }}
|
|
fqdn: {{ common.fqdn }}
|
|
|
|
|
|
# add entries to rsyslog configuration
|
|
rsyslog:
|
|
- filename: 00-remote.conf
|
|
content: |
|
|
$template LogToMaster, "<%PRI%>1 %$NOW%T%TIMESTAMP:8:$%Z %HOSTNAME% %APP-NAME% %PROCID% %MSGID% -%msg%\n"
|
|
*.* @{{ common.master_ip }};LogToMaster
|
|
|
|
|
|
# that module's missing in 0.6.3, but existent for >= 0.7.3
|
|
write_files:
|
|
- content: |
|
|
---
|
|
url: {{ common.master_url }}
|
|
path: /etc/nailgun-agent/config.yaml
|
|
- content: target
|
|
path: /etc/nailgun_systemtype
|
|
|
|
mcollective:
|
|
conf:
|
|
main_collective: mcollective
|
|
collectives: mcollective
|
|
libdir: /usr/share/mcollective/plugins
|
|
logfile: /var/log/mcollective.log
|
|
loglevel: debug
|
|
daemonize: 0
|
|
direct_addressing: 1
|
|
ttl: 4294957
|
|
securityprovider: psk
|
|
plugin.psk: {{ mcollective.pskey }}
|
|
identity: {{ mcollective.identity }}
|
|
{% if mcollective.connector == 'stomp' %}
|
|
connector = stomp
|
|
plugin.stomp.host: {{ mcollective.host }}
|
|
plugin.stomp.port: {{ mcollective.port|default(61613) }}
|
|
plugin.stomp.user: {{ mcollective.user }}
|
|
plugin.stomp.password: {{ mcollective.password }}
|
|
{% else %}
|
|
connector: rabbitmq
|
|
plugin.rabbitmq.vhost: {{ mcollective.vhost }}
|
|
plugin.rabbitmq.pool.size: 1
|
|
plugin.rabbitmq.pool.1.host: {{ mcollective.host }}
|
|
plugin.rabbitmq.pool.1.port: {{ mcollective.port|default(61613) }}
|
|
plugin.rabbitmq.pool.1.user: {{ mcollective.user }}
|
|
plugin.rabbitmq.pool.1.password: {{ mcollective.password }}
|
|
plugin.rabbitmq.heartbeat_interval: 30
|
|
{% endif %}
|
|
factsource: yaml
|
|
plugin.yaml: /etc/mcollective/facts.yaml
|
|
|
|
puppet:
|
|
conf:
|
|
main:
|
|
logdir: /var/log/puppet
|
|
rundir: /var/run/puppet
|
|
ssldir: $vardir/ssl
|
|
pluginsync: true
|
|
prerun_command: /bin/true
|
|
postrun_command: /bin/true
|
|
stringify_facts: false
|
|
agent:
|
|
classfile: $vardir/classes.txt
|
|
localconfig: $vardir/localconfig
|
|
server: {{ puppet.master }}
|
|
report: false
|
|
configtimeout: 600
|
|
|
|
runcmd:
|
|
{% if puppet.enable != 1 %}
|
|
- /usr/sbin/invoke-rc.d puppet stop
|
|
- /usr/sbin/update-rc.d -f puppet remove
|
|
{% endif %}
|
|
{% if mcollective.enable != 1 %}
|
|
- /usr/sbin/invoke-rc.d mcollective stop
|
|
- echo manual > /etc/init/mcollective.override
|
|
{% else %}
|
|
- rm -f /etc/init/mcollective.override
|
|
{% endif %}
|
|
- iptables -t filter -F INPUT
|
|
- iptables -t filter -F FORWARD
|
|
|
|
final_message: "YAY! The system is finally up, after $UPTIME seconds"
|