diff --git a/AUTHORS.md b/AUTHORS.md
index 001fa6c..e31c3e7 100644
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -4,7 +4,7 @@ This list is sorted by the number of commits per contributor in _descending_ ord
Avatar|Contributor|Contributions
:-:|---|:-:
-
|[@myii](https://github.com/myii)|44
+
|[@myii](https://github.com/myii)|45
|[@javierbertoli](https://github.com/javierbertoli)|24
|[@martinhoefling](https://github.com/martinhoefling)|16
|[@fortunejuggle](https://github.com/fortunejuggle)|13
@@ -25,6 +25,7 @@ Avatar|Contributor|Contributions
|[@OrangeDog](https://github.com/OrangeDog)|1
|[@anderbubble](https://github.com/anderbubble)|1
|[@Artanicus](https://github.com/Artanicus)|1
+
|[@kiniou](https://github.com/kiniou)|1
|[@itbabu](https://github.com/itbabu)|1
|[@mrichar1](https://github.com/mrichar1)|1
|[@xenophonf](https://github.com/xenophonf)|1
@@ -37,4 +38,4 @@ Avatar|Contributor|Contributions
---
-Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2020-07-29.
+Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2020-08-26.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 31e4fab..9f40cde 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,26 @@
# Changelog
+# [2.0.0](https://github.com/saltstack-formulas/letsencrypt-formula/compare/v1.1.0...v2.0.0) (2020-08-26)
+
+
+### Code Refactoring
+
+* use domains' setname as --cert-name option ([68fb247](https://github.com/saltstack-formulas/letsencrypt-formula/commit/68fb2475508fea71caf542f62be0e5ce3789e90e))
+
+
+### BREAKING CHANGES
+
+* Since this domains' setname was not used, the path was named
+after the first domain in the domains set. In order to keep using this workflow,
+you need to rename the setname with the first domain in the list like the
+following:
+```
+letsencrypt:
+ domains:
+ foo.example.com:
+ - foo.example.com
+```
+
# [1.1.0](https://github.com/saltstack-formulas/letsencrypt-formula/compare/v1.0.0...v1.1.0) (2020-07-29)
diff --git a/FORMULA b/FORMULA
index f146c10..bd2a866 100644
--- a/FORMULA
+++ b/FORMULA
@@ -1,7 +1,7 @@
name: letsencrypt
os: Debian, Ubuntu, Raspbian, RedHat, Fedora, CentOS, Suse, openSUSE, Gentoo, Funtoo, Arch, Manjaro, Alpine, FreeBSD, OpenBSD, Solaris, SmartOS, Windows, MacOS
os_family: Debian, RedHat, Suse, Gentoo, Arch, Alpine, FreeBSD, OpenBSD, Solaris, Windows, MacOS
-version: 1.1.0
+version: 2.0.0
release: 1
minimum_version: 2017.7
summary: letsencrypt formula
diff --git a/docs/AUTHORS.rst b/docs/AUTHORS.rst
index eea6d79..4e8a468 100644
--- a/docs/AUTHORS.rst
+++ b/docs/AUTHORS.rst
@@ -15,7 +15,7 @@ This list is sorted by the number of commits per contributor in *descending* ord
- Contributions
* - :raw-html-m2r:`
`
- `@myii `_
- - 44
+ - 45
* - :raw-html-m2r:`
`
- `@javierbertoli `_
- 24
@@ -76,6 +76,9 @@ This list is sorted by the number of commits per contributor in *descending* ord
* - :raw-html-m2r:`
`
- `@Artanicus `_
- 1
+ * - :raw-html-m2r:`
`
+ - `@kiniou `_
+ - 1
* - :raw-html-m2r:`
`
- `@itbabu `_
- 1
@@ -107,4 +110,4 @@ This list is sorted by the number of commits per contributor in *descending* ord
----
-Auto-generated by a `forked version `_ of `gaocegege/maintainer `_ on 2020-07-29.
+Auto-generated by a `forked version `_ of `gaocegege/maintainer `_ on 2020-08-26.
diff --git a/docs/CHANGELOG.rst b/docs/CHANGELOG.rst
index 42f566b..bbc13cf 100644
--- a/docs/CHANGELOG.rst
+++ b/docs/CHANGELOG.rst
@@ -2,6 +2,30 @@
Changelog
=========
+`2.0.0 `_ (2020-08-26)
+-------------------------------------------------------------------------------------------------------------
+
+Code Refactoring
+^^^^^^^^^^^^^^^^
+
+
+* use domains' setname as --cert-name option (\ `68fb247 `_\ )
+
+BREAKING CHANGES
+^^^^^^^^^^^^^^^^
+
+
+* Since this domains' setname was not used, the path was named
+ after the first domain in the domains set. In order to keep using this workflow,
+ you need to rename the setname with the first domain in the list like the
+ following:
+ .. code-block::
+
+ letsencrypt:
+ domains:
+ foo.example.com:
+ - foo.example.com
+
`1.1.0 `_ (2020-07-29)
-------------------------------------------------------------------------------------------------------------
diff --git a/letsencrypt/domains.sls b/letsencrypt/domains.sls
index 11a8ca9..a14835e 100644
--- a/letsencrypt/domains.sls
+++ b/letsencrypt/domains.sls
@@ -41,8 +41,8 @@
# represent SubjectAlternativeNames
create-initial-cert-{{ setname }}-{{ domainlist | join('+') }}:
cmd.run:
- - unless: {{ check_cert_cmd }} {{ domainlist[0] }}
- - name: {{ create_cert_cmd }} certonly --quiet -d {{ domainlist|join(' -d ') }} --non-interactive
+ - unless: {{ check_cert_cmd }} {{ setname }}
+ - name: {{ create_cert_cmd }} certonly --quiet --cert-name {{ setname }} -d {{ domainlist|join(' -d ') }} --non-interactive
{% if not letsencrypt.use_package %}
- cwd: {{ letsencrypt.cli_install_dir }}
{% endif %}
@@ -70,14 +70,14 @@ letsencrypt-crontab-{{ setname }}-{{ domainlist[0] }}:
- file: {{ renew_cert_cmd }}
{% endif %}
-create-fullchain-privkey-pem-for-{{ domainlist[0] }}:
+create-fullchain-privkey-pem-for-{{ setname }}:
cmd.run:
- name: |
- cat {{ letsencrypt.config_dir.path }}/live/{{ domainlist[0] }}/fullchain.pem \
- {{ letsencrypt.config_dir.path }}/live/{{ domainlist[0] }}/privkey.pem \
- > {{ letsencrypt.config_dir.path }}/live/{{ domainlist[0] }}/fullchain-privkey.pem && \
- chmod 600 {{ letsencrypt.config_dir.path }}/live/{{ domainlist[0] }}/fullchain-privkey.pem
- - creates: {{ letsencrypt.config_dir.path }}/live/{{ domainlist[0] }}/fullchain-privkey.pem
+ cat {{ letsencrypt.config_dir.path }}/live/{{ setname }}/fullchain.pem \
+ {{ letsencrypt.config_dir.path }}/live/{{ setname }}/privkey.pem \
+ > {{ letsencrypt.config_dir.path }}/live/{{ setname }}/fullchain-privkey.pem && \
+ chmod 600 {{ letsencrypt.config_dir.path }}/live/{{ setname }}/fullchain-privkey.pem
+ - creates: {{ letsencrypt.config_dir.path }}/live/{{ setname }}/fullchain-privkey.pem
- require:
- cmd: create-initial-cert-{{ setname }}-{{ domainlist | join('+') }}