# Automate Discourse Docker with Ansible

**URL:** <https://meta.discourse.org/t/automate-discourse-docker-with-ansible/67150>\
**Category:** Self-hosting\
**Tags:** unsupported-install, hosting\
**Created:** [31 juli 2017 om 08:54 UTC](https://meta.discourse.org/t/automate-discourse-docker-with-ansible/67150 "2017-07-31T08:54:17Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![ahmed\_alamiry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmed_alamiry/32/198190_2.png) [@ahmed\_alamiry](https://meta.discourse.org/u/ahmed_alamiry)\
**Post date:** [30 januari 2019 om 08:44 UTC](https://meta.discourse.org/t/automate-discourse-docker-with-ansible/67150/9 "2019-01-30T08:44:57Z")

</div>

Thank you, it worked for me using rake admin:create,

Now, I am trying to add this part under RUN: in the app.yml

```
 - exec:rails r "u = User.create!(username: '{{ discourse_developer_username }}', email: '{{ discourse_developer_emails }}', password: ' {{ discourse_developer_password }}', admin: true)"

```

but it fails, even when I uncomment:

```
- exec: rails r "SiteSetting.notification_email='discourse@example.com'"

```

so how to run a rails command with out going through:

```
cd /var/discourse 
./launcher enter app
rails r "......." which it works 

```

and one more question, how to import theme through command line.

---

_[View the full topic](https://meta.discourse.org/t/automate-discourse-docker-with-ansible/67150)._
