# Cloud-config arguments to services?

**URL:** https://forums.suse.com/t/cloud-config-arguments-to-services/2959
**Category:** RancherOS
**Created:** [May 30, 2016, 8:07am UTC](https://forums.suse.com/t/cloud-config-arguments-to-services/2959 "2016-05-30T08:07:13Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Raboo](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/raboo/32/1381_2.png) [@Raboo](https://forums.suse.com/u/Raboo)
#### Post date: [May 30, 2016, 8:07am UTC](https://forums.suse.com/t/cloud-config-arguments-to-services/2959/1 "2016-05-30T08:07:13Z")

</div>

Hi,

I’m trying to build a cloud-config for a docker container that needs some arguments.  
But I cannot find anything in the RancherOS documentation on passing arguments to “services”.  
So I wonder if this is correct in the last line…?

```
#cloud-config
rancher:
  services:
    consul:
      image: progrium/consul
      restart: always
      ports:
       - 8300:8300
       - 8301:8301
       - 8301:8301/udp
       - 8302:8302
       - 8302:8302/udp
       - 8400:8400
       - 8500:8500
       - 53:53/udp
       net: host
       volumes:
       - /media:/data:rw
      args: [-server, -bootstrap-expect 3]
```

---

<div class="post-metadata">

### Author: ![Raboo](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/raboo/32/1381_2.png) [@Raboo](https://forums.suse.com/u/Raboo)
#### Post date: [May 31, 2016, 9:10am UTC](https://forums.suse.com/t/cloud-config-arguments-to-services/2959/2 "2016-05-31T09:10:25Z")

</div>

This didn’t work `args: [-server, -advertise 10.3.20.72 -bootstrap-expect 3 -join consul.service.consul]`.  
So still no way send arguments to the docker service via cloud-config…😢

---

<div class="post-metadata">

### Author: ![stuart](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/stuart/32/1084_2.png) [@stuart](https://forums.suse.com/u/stuart)
#### Post date: [May 31, 2016, 10:44am UTC](https://forums.suse.com/t/cloud-config-arguments-to-services/2959/3 "2016-05-31T10:44:01Z")

</div>

Wouldn’t it be command: ?

---

<div class="post-metadata">

### Author: ![pavlod](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@pavlod](https://forums.suse.com/u/pavlod)
#### Post date: [May 31, 2016, 12:35pm UTC](https://forums.suse.com/t/cloud-config-arguments-to-services/2959/4 "2016-05-31T12:35:51Z")

</div>

```
#cloud-config
rancher:
  services:
    consul:
      image: progrium/consul
      net: host
      command: -server -log-level debug -node=consul.local -bootstrap -bind=<IP> -client=<IP> -advertise=<IP>
      labels:
        io.rancher.os.scope: system
        io.rancher.os.after: docker
```

---

<div class="post-metadata">

### Author: ![Raboo](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/raboo/32/1381_2.png) [@Raboo](https://forums.suse.com/u/Raboo)
#### Post date: [May 31, 2016, 1:29pm UTC](https://forums.suse.com/t/cloud-config-arguments-to-services/2959/5 "2016-05-31T13:29:25Z")

</div>

Thanks!

Is there a way to find out all available rancher specific cloud-config settings? Or is it guesswork/reading source code?  
This documentation doesn’t say much [http://docs.rancher.com/os/cloud-config/](http://docs.rancher.com/os/cloud-config/).

---

<div class="post-metadata">

### Author: ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)
#### Post date: [May 31, 2016, 4:05pm UTC](https://forums.suse.com/t/cloud-config-arguments-to-services/2959/6 "2016-05-31T16:05:13Z")

</div>

It looks like you are trying to create some services within RancherOS.

All services should be in docker-compose format, which would be located

```auto
rancher:
  services:
    servicename:

```

Are there other settings that you are trying to do?

---

<div class="post-metadata">

### Author: ![Raboo](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/raboo/32/1381_2.png) [@Raboo](https://forums.suse.com/u/Raboo)
#### Post date: [June 1, 2016, 6:53am UTC](https://forums.suse.com/t/cloud-config-arguments-to-services/2959/7 "2016-06-01T06:53:40Z")

</div>

> [@denise](#):
>
> Are there other settings that you are trying to do?

Well I’m trying to figure out where to write a startup script that is executed before the user-docker, but I asked in a separate thread.

> [@Cloud-config run commands on startup](http://forums.suse.com/t/cloud-config-run-commands-on-startup/2971):
>
> Is there a file that will execute before user-docker? I’ve seen examples like this #cloud-config write\_files: - path: /opt/rancher/bin/start.sh permissions: "0755" owner: root content: | #!/bin/bash echo "I'm doing things on start" \> /opt/start-sh-did-this But there is no /opt/rancher/bin/ folder. So is this outdated information? What place have this file moved to?

---

<div class="post-metadata">

### Author: ![Raboo](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/raboo/32/1381_2.png) [@Raboo](https://forums.suse.com/u/Raboo)
#### Post date: [June 1, 2016, 9:25am UTC](https://forums.suse.com/t/cloud-config-arguments-to-services/2959/8 "2016-06-01T09:25:49Z")

</div>

Now it stopped working, previously I was at least able to install consul at boot.  
But now it doesn’t do anything, it just boots the OS.  
I can’t seem to find any log where i can see what happens.

```
#cloud-config
rancher:
  network:
    interfaces:
      eth*:
        dhcp: true
  state:
    fstype: auto
    formatzero: true
    dev: LABEL=RANCHER_STATE
    autoformat:
    - /dev/vda
    - /dev/sda
  services:
    consul:
      image: progrium/consul
      restart: always
      ports:
      - "8300-8300"
      - "8301:8301"
      - "8302:8302"
      - "8301:8301/udp"
      - "8302:8302/udp"
      - "8400:8400"
      - "8500:8500"
      - "53:53/udp"
      volumes:
      - /media:/data
      command: -server -advertise <%= @host.ip %> -bootstrap-expect 3 -join consul.service.consul
write_files:
  # /opt/rancher/bin/start.sh is executed on start before User Docker starts
  # /etc/rc.local is also executed on start but not guaranteed to be ran before User Docker
  - path: /opt/rancher/bin/start.sh
    permissions: "0755"
    owner: root
    content: |
      #!/bin/bash
      wget --quiet --output-document=/dev/null --no-check-certificate <%= foreman_url %>
      touch /.bootstrapped
      rm -f /opt/rancher/bin/start.sh

```

This is my ipxe/cmdline

```
$ cat /proc/cmdline
rancher.debug=true rancher.password=xxx rancher.cloud_init.datasources=[url] cloud-config-url=http://url.to/cloud-config.yml
```
