Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: systemd target to synchronize instances of afterburn-sshkeys@.service #417

Closed
rfairley opened this issue May 22, 2020 · 1 comment · Fixed by #481
Closed
Assignees
Labels
jira for syncing to jira

Comments

@rfairley
Copy link

Feature Request

Environment

What hardware/cloud provider/hypervisor is being used to run Afterburn?

libvirt running Fedora CoreOS when this was brought up - applies to all platforms though.

Desired Feature

Add a target afterburn-sshkeys.target, and have the afterburn-sshkeys@.service template specify RequiredBy=afterburn-sshkeys.target in the [Install] section. This would allow other units to synchronize around any instance of afterburn-sshkeys@, not only for a given user (e.g. afterburn-sshkeys@core.service, see coreos/fedora-coreos-config#344 (comment)).

First need to test/investigate manually if this approach works - filing as an initial suggestion, and potentially can investigate other ideas for the synchronization here if this does not work.

@darkmuggle darkmuggle added the jira for syncing to jira label Jul 9, 2020
@bh7cw bh7cw assigned bh7cw and unassigned bh7cw Jul 10, 2020
@bh7cw
Copy link
Contributor

bh7cw commented Aug 17, 2020

Manually created afterburn-sshkeys.target, and added RequiredBy=afterburn-sshkeys.target in afterburn-sshkeys@.service template on FCOS 32 created on AWS.
Each time run systemctl start afterburn-sshkeys.target, all the template instances will be updated:

systemctl status 'afterburn-sshkeys@*.service' --all
● afterburn-sshkeys@test.service - Afterburn (SSH Keys)
     Loaded: loaded (/etc/systemd/system/afterburn-sshkeys@.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Mon 2020-08-17 14:11:57 UTC; 5min ago
    Process: 3951 ExecStart=/usr/bin/afterburn ${AFTERBURN_OPT_PROVIDER} --ssh-keys=test (code=exited, status=0/SUCCESS)
   Main PID: 3951 (code=exited, status=0/SUCCESS)

Aug 17 14:11:56 ip-172-31-8-83 systemd[1]: Starting Afterburn (SSH Keys)...
Aug 17 14:11:56 ip-172-31-8-83 afterburn[3951]: Aug 17 14:11:56.992 INFO Putting http://169.254.169.254/latest/api/token: Attempt #1
Aug 17 14:11:57 ip-172-31-8-83 afterburn[3951]: Aug 17 14:11:57.047 INFO Fetching http://169.254.169.254/2019-10-01/meta-data/public-keys: Attempt #1
Aug 17 14:11:57 ip-172-31-8-83 afterburn[3951]: Aug 17 14:11:57.074 INFO Fetch successful
Aug 17 14:11:57 ip-172-31-8-83 afterburn[3951]: Aug 17 14:11:57.074 INFO Fetching http://169.254.169.254/2019-10-01/meta-data/public-keys/0/openssh-key: Attempt >
Aug 17 14:11:57 ip-172-31-8-83 afterburn[3951]: Aug 17 14:11:57.076 INFO Fetch successful
Aug 17 14:11:57 ip-172-31-8-83 afterburn[3951]: wrote ssh authorized keys file for user: test
Aug 17 14:11:57 ip-172-31-8-83 systemd[1]: afterburn-sshkeys@test.service: Succeeded.
Aug 17 14:11:57 ip-172-31-8-83 systemd[1]: Finished Afterburn (SSH Keys).

● afterburn-sshkeys@core.service - Afterburn (SSH Keys)
     Loaded: loaded (/etc/systemd/system/afterburn-sshkeys@.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Mon 2020-08-17 14:11:57 UTC; 5min ago
    Process: 3950 ExecStart=/usr/bin/afterburn ${AFTERBURN_OPT_PROVIDER} --ssh-keys=core (code=exited, status=0/SUCCESS)
   Main PID: 3950 (code=exited, status=0/SUCCESS)

Aug 17 14:11:56 ip-172-31-8-83 systemd[1]: Starting Afterburn (SSH Keys)...
Aug 17 14:11:56 ip-172-31-8-83 afterburn[3950]: Aug 17 14:11:56.993 INFO Putting http://169.254.169.254/latest/api/token: Attempt #1
Aug 17 14:11:57 ip-172-31-8-83 afterburn[3950]: Aug 17 14:11:57.047 INFO Fetching http://169.254.169.254/2019-10-01/meta-data/public-keys: Attempt #1
Aug 17 14:11:57 ip-172-31-8-83 afterburn[3950]: Aug 17 14:11:57.074 INFO Fetch successful
Aug 17 14:11:57 ip-172-31-8-83 afterburn[3950]: Aug 17 14:11:57.074 INFO Fetching http://169.254.169.254/2019-10-01/meta-data/public-keys/0/openssh-key: Attempt >
Aug 17 14:11:57 ip-172-31-8-83 afterburn[3950]: Aug 17 14:11:57.076 INFO Fetch successful
Aug 17 14:11:57 ip-172-31-8-83 afterburn[3950]: wrote ssh authorized keys file for user: core
Aug 17 14:11:57 ip-172-31-8-83 systemd[1]: afterburn-sshkeys@core.service: Succeeded.
Aug 17 14:11:57 ip-172-31-8-83 systemd[1]: Finished Afterburn (SSH Keys).

bh7cw added a commit to bh7cw/afterburn that referenced this issue Aug 17, 2020
this adds afterburn-sshkeys.target, and has the afterburn-sshkeys@.service
template specify RequiredBy=afterburn-sshkeys.target in the [Install]
section.

Fixes coreos#417
bh7cw added a commit to bh7cw/afterburn that referenced this issue Aug 18, 2020
this adds afterburn-sshkeys.target, and has the afterburn-sshkeys@.service
template specify RequiredBy=afterburn-sshkeys.target in the [Install]
section.

Fixes coreos#417
bh7cw added a commit to bh7cw/fedora-coreos-config that referenced this issue Aug 20, 2020
this updates `afterburn-sshkeys@core.service` to `afterburn-sshkeys.target`
in order to synchronize around any instance of `afterburn-sshkeys@`.

Follow up coreos/afterburn#417
bh7cw added a commit to bh7cw/fedora-coreos-config that referenced this issue Aug 20, 2020
this updates `afterburn-sshkeys@core.service` to `afterburn-sshkeys.target`
in order to synchronize around any instance of `afterburn-sshkeys@`.

Follows up coreos/afterburn#417 and
coreos/afterburn#481
bh7cw added a commit to bh7cw/fedora-coreos-config that referenced this issue Sep 14, 2020
this updates `afterburn-sshkeys@core.service` to `afterburn-sshkeys.target`
in order to synchronize around any instance of `afterburn-sshkeys@`.

Follows up coreos/afterburn#417 and
coreos/afterburn#481
bh7cw added a commit to bh7cw/fedora-coreos-config that referenced this issue Sep 17, 2020
this updates `afterburn-sshkeys@core.service` to `afterburn-sshkeys.target`
and presets `afterburn-sshkeys.target` in order to synchronize around any
instance of `afterburn-sshkeys@`.

Follows up coreos/afterburn#417 and
coreos/afterburn#481
bh7cw added a commit to bh7cw/fedora-coreos-config that referenced this issue Sep 17, 2020
this updates `afterburn-sshkeys@core.service` to `afterburn-sshkeys.target`
and presets `afterburn-sshkeys.target` in order to synchronize around any
instance of `afterburn-sshkeys@`.

Follows up coreos/afterburn#417 and
coreos/afterburn#481
bh7cw added a commit to bh7cw/fedora-coreos-config that referenced this issue Sep 17, 2020
this updates `afterburn-sshkeys@core.service` to `afterburn-sshkeys.target`
and presets `afterburn-sshkeys.target` in order to synchronize around any
instance of `afterburn-sshkeys@`.

Follows up coreos/afterburn#417 and
coreos/afterburn#481
bh7cw added a commit to bh7cw/fedora-coreos-config that referenced this issue Sep 17, 2020
this updates `afterburn-sshkeys@core.service` to `afterburn-sshkeys.target`
and presets `afterburn-sshkeys.target` in order to synchronize around any
instance of `afterburn-sshkeys@`.

Follows up coreos/afterburn#417 and
coreos/afterburn#481
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira for syncing to jira
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants