ami_creator_pre.sls
author Paul Tonelli <paul.tonelli@logilab.fr>
Mon, 11 Mar 2013 15:27:04 +0100
changeset 57 28cbe9dbaf1f
parent 54 7e33d0c7f399
child 59 c062ff185a14
permissions -rw-r--r--
added debian config file to avoir conf messages (do you want to replace previously modified config file...)

### unarchived files ###
variation_extracted:
    archive.extracted:
        - name: /mnt/
        - source: salt://variation_debian.tar.gz
        - archive_format: tar
        - tar_options: z
        - if_missing: variation.img

### Resize the partition ###
resize_variation:
    tmp_state.resized:
        - name: /mnt/variation.img
        - size: 3G
        - require:
            - archive.extracted: variation_extracted

###  Directories ###
/mnt/variation:
    file.directory:
        - user: root
        - group: root
        - mode: 755
        - makedirs: True

### Mounts ###
mounted_variation:
    mount.mounted:
        - device: /mnt/variation.img
        - name: /mnt/variation
        - fstype: ext4
        - mkmnt: False
        - opts:
            - loop
        - require:
            - file.directory: /mnt/variation
            - tmp_state.resized: resize_variation

chroot_proc:
    mount.mounted:
        - device: none
        - name: /mnt/variation/proc
        - fstype: proc
        - mkmnt: false
        - require:
            - mount.mounted: mounted_variation

chroot_devpts:
    mount.mounted:
        - device: none
        - name: /mnt/variation/dev/pts
        - fstype: devpts
        - mkmnt: False
        - require:
            - mount.mounted: mounted_variation

### Temporary Files ###
01proxy:
    file.managed:
        - name: /mnt/variation/etc/apt/apt.conf.d/01proxy
        - source: salt://others/01proxy
        - mode: 644
        - require:
            - mount.mounted: mounted_variation

02confold:
    file.managed:
        - name: /mnt/variation/etc/apt/apt.conf.d/02confold
        - source: salt://others/02confold
        - mode: 644
        - require:
            - mount.mounted: mounted_variation

policy-rc.d:
    file.managed:
        - name: /mnt/variation/usr/sbin/policy-rc.d
        - source: salt://others/policy-rc.d
        - mode: 755
        - require:
            - mount.mounted: mounted_variation

unstable.list:
    file.managed:
        - name: /mnt/variation/etc/apt/sources.list.d/unstable.list
        - source: salt://others/unstable.list
        - mode: 644
        - require:
            - mount.mounted: mounted_variation

pinning:
    file.managed:
        - name: /mnt/variation/etc/apt/preferences.d/pinning
        - source: salt://others/pinning
        - mode: 644
        - require:
            - mount.mounted: mounted_variation

minion:
    file.managed:
        - name: /mnt/variation/etc/salt/minion
        - source: salt://variation.minion
        - mode: 644
        - require:
            - mount.mounted: mounted_variation

variation.sls:
    file.managed:
        - name: /mnt/variation/etc/salt/srv/variation.sls
        - source: salt://variation.sls
        - mode: 644
        - require:
            - mount.mounted: mounted_variation

variation.top.sls:
    file.managed:
        - name: /mnt/variation/etc/salt/srv/top.sls
        - source: salt://variation.top.sls
        - mode: 644
        - require:
            - mount.mounted: mounted_variation

resolv.conf:
    tmp_state.local_managed:
        - name: /mnt/variation/etc/resolv.conf
        - source: /etc/resolv.conf
        - require:
            - mount.mounted: mounted_variation