Sunday, November 25, 2012

AeroFS and symlinks

Start an Administrator Command shell CMD.EXE. Use mklink to create a directory symbolic link of your Pictures folder inside the AeroFS folder. This way your Pictures Folder will peer2peer sync between your computers.

Change directory to your AeroFS document folder:
C:\> cd C:\Users\username\Documents\AeroFS
C:\Users\username\Documents\AeroFS> mklink /D Pictures C:\User\username\Pictures\

//Christian

Wednesday, November 21, 2012

How to template eth0 ip address with Saltstack Jinja


You can test the output of salt network interfaces with
# salt 'some-machine' network.interfaces

Here is the Salt state file, we will write /etc/haproxy/haproxy.cfg with the context of the eth0 ip address
Below is the content of haproxy.sls
#
# Write /etc/haproxy/haproxy.cfg
#
/etc/haproxy/haproxy.cfg:
  file.managed:
    - source: salt://files/etc/haproxy/haproxy.cfg
    - user: root
    - group: root
    - mode: 640
    - template: jinja
    - context:
        ip: {{ salt['network.interfaces']()['eth0']['inet'][0]['address'] }}

file referenced in source: salt:// above content of files/etc/haproxy/haproxy.cfg
the important part is to write the variable in thise case ip as {{ variable }}

listen stats {{ ip }}:10000