octodns / octodns-cloudflare

Cloudflare DNS provider for octoDNS
MIT License
25 stars 18 forks source link

Cloudflare: Alias record type on Apex always shows up as changing when proxied: true #7

Closed Moumoutaru closed 2 years ago

Moumoutaru commented 6 years ago

Alias records on the Apex always show up as changing when proxied is set to true. Removing the proxied: true shows no records changing and doesn't undo the proxy through cloudflare config. Is any of this expected behavior? I would expect removing proxied: true, or setting proxied: false to actually change this apex record.

---
? ''
: - octodns:
      cloudflare:
        proxied: true
    ttl: 1
    type: ALIAS
    value: 123.kewlzone.net.
(env)  ~/git/octodns   amurphy/kewlzone-net ●  octodns-sync --config-file=./config.yml kewlzone.net.     
2018-11-27T09:53:20  [140136761390272] INFO  Manager __init__: config_file=./config.yml
2018-11-27T09:53:20  [140136761390272] INFO  Manager __init__:   max_workers=1
2018-11-27T09:53:20  [140136761390272] INFO  Manager __init__:   max_workers=False
2018-11-27T09:53:20  [140136761390272] INFO  Manager sync: eligible_zones=['kewlzone.net.'], eligible_targets=[], dry_run=True, force=False
2018-11-27T09:53:20  [140136761390272] INFO  Manager sync:   zone=kewlzone.net.
2018-11-27T09:53:20  [140136761390272] INFO  Manager sync:   sources=['config'] -> targets=['cloudflare']
2018-11-27T09:53:20  [140136761390272] INFO  YamlProvider[config] populate:   found 6 records, exists=False
2018-11-27T09:53:20  [140136761390272] INFO  CloudflareProvider[cloudflare] plan: desired=kewlzone.net.
2018-11-27T09:53:21  [140136761390272] INFO  CloudflareProvider[cloudflare] populate:   found 6 records, exists=True
2018-11-27T09:53:21  [140136761390272] INFO  CloudflareProvider[cloudflare] plan:   filtered out 1 changes
2018-11-27T09:53:21  [140136761390272] INFO  CloudflareProvider[cloudflare] plan:   extra changes
  Update
    <AliasRecord ALIAS 1, kewlzone.net., 123.kewlzone.net.> ->
    <AliasRecord ALIAS 1, kewlzone.net., 123.kewlzone.net.> (config)
2018-11-27T09:53:21  [140136761390272] INFO  CloudflareProvider[cloudflare] plan:   Creates=0, Updates=1, Deletes=0, Existing Records=6
2018-11-27T09:53:21  [140136761390272] INFO  Manager 
********************************************************************************
* kewlzone.net.
********************************************************************************
* cloudflare (CloudflareProvider)
*   Update
*     <AliasRecord ALIAS 1, kewlzone.net., 123.kewlzone.net.> ->
*     <AliasRecord ALIAS 1, kewlzone.net., 123.kewlzone.net.> (config)
*   Summary: Creates=0, Updates=1, Deletes=0, Existing Records=6
********************************************************************************
ross commented 5 years ago

I'm not able to reproduce this locally. Always running ./octodns/cmds/sync.py --config-file=config/dev.yaml --doit Initially I synced with:

---
www:
  - type: A
    value: 1.2.3.5
  - type: AAAA
    value: 2001:0db8:85a3:0:0:8a2e:0370:7334
screen shot 2018-12-09 at 2 01 14 pm

Then I added a proxied ALIAS/CNAME:

---
'':
  octodns:
    cloudflare:
      proxied: true
  ttl: 3600
  type: ALIAS
  value: www.aliased.net.
www:
  - type: A
    value: 1.2.3.5
  - type: AAAA
    value: 2001:0db8:85a3:0:0:8a2e:0370:7334
********************************************************************************
* aliased.net.
********************************************************************************
* cloudflare (CloudflareProvider)
*   Create <AliasRecord ALIAS 3600, aliased.net., www.aliased.net.> (config)
*   Summary: Creates=1, Updates=0, Deletes=0, Existing Records=3
********************************************************************************
screen shot 2018-12-09 at 2 02 53 pm

Subsequent sync's don't show any changes:

********************************************************************************
No changes were planned
********************************************************************************

If I remove the proxied flag that seems to behave as expected:

********************************************************************************
* aliased.net.
********************************************************************************
* cloudflare (CloudflareProvider)
*   Update
*     <AliasRecord ALIAS 1, aliased.net., www.aliased.net.> ->
*     <AliasRecord ALIAS 3600, aliased.net., www.aliased.net.> (config)
*   Summary: Creates=0, Updates=1, Deletes=0, Existing Records=4
********************************************************************************

And then subsequent syncs

********************************************************************************
No changes were planned
********************************************************************************
ross commented 5 years ago

I did find a problem with deleting ALIAS records from Cloudflare while trying to reproduce this bug, https://github.com/github/octodns/pull/305. Based on the description it doesn't sound like what you're running into. It has nothing to do with proxied flag and deleting it, just a general problem were you can't delete an ALIAS record.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.